From 2a1fe06be183dee677e3875c24aa4a48644504f6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 12 Nov 2019 13:21:53 -0800 Subject: [PATCH] feat: adds GetAnnotationSpec, DeployModel, UndeployModel, ExportModel (#258) --- packages/google-cloud-automl/.nycrc | 1 - packages/google-cloud-automl/README.md | 1 - .../cloud/automl/v1/annotation_payload.proto | 31 +- .../cloud/automl/v1/annotation_spec.proto | 46 + .../cloud/automl/v1/classification.proto | 172 + .../google/cloud/automl/v1/data_items.proto | 157 +- .../google/cloud/automl/v1/dataset.proto | 20 +- .../google/cloud/automl/v1/detection.proto | 88 + .../google/cloud/automl/v1/geometry.proto | 48 + .../protos/google/cloud/automl/v1/image.proto | 194 + .../protos/google/cloud/automl/v1/io.proto | 828 +- .../protos/google/cloud/automl/v1/model.proto | 29 +- .../cloud/automl/v1/model_evaluation.proto | 36 +- .../google/cloud/automl/v1/operations.proto | 103 +- .../cloud/automl/v1/prediction_service.proto | 128 +- .../google/cloud/automl/v1/service.proto | 111 +- .../protos/google/cloud/automl/v1/text.proto | 60 + .../cloud/automl/v1/text_extraction.proto | 70 + .../google/cloud/automl/v1/text_segment.proto | 43 + .../cloud/automl/v1/text_sentiment.proto | 79 + .../google/cloud/automl/v1/translation.proto | 9 +- .../cloud/automl/v1beta1/classification.proto | 17 +- .../cloud/automl/v1beta1/data_items.proto | 8 +- .../google/cloud/automl/v1beta1/image.proto | 14 +- .../google/cloud/automl/v1beta1/io.proto | 7 +- .../cloud/automl/v1beta1/operations.proto | 25 +- .../google/cloud/automl/v1beta1/tables.proto | 15 +- .../google/cloud/automl/v1beta1/text.proto | 28 +- .../google-cloud-automl/protos/protos.d.ts | 10155 +++++-- packages/google-cloud-automl/protos/protos.js | 24595 ++++++++++++---- .../google-cloud-automl/protos/protos.json | 2069 +- .../google-cloud-automl/samples/README.md | 17 - .../src/v1/auto_ml_client.js | 516 +- .../src/v1/auto_ml_client_config.json | 20 + .../cloud/automl/v1/doc_annotation_payload.js | 33 + .../cloud/automl/v1/doc_annotation_spec.js | 43 + .../cloud/automl/v1/doc_classification.js | 218 + .../google/cloud/automl/v1/doc_data_items.js | 238 +- .../doc/google/cloud/automl/v1/doc_dataset.js | 25 + .../google/cloud/automl/v1/doc_detection.js | 113 + .../google/cloud/automl/v1/doc_geometry.js | 55 + .../doc/google/cloud/automl/v1/doc_image.js | 227 + .../v1/doc/google/cloud/automl/v1/doc_io.js | 846 +- .../doc/google/cloud/automl/v1/doc_model.js | 29 + .../cloud/automl/v1/doc_model_evaluation.js | 32 +- .../cloud/automl/v1/doc_prediction_service.js | 117 + .../doc/google/cloud/automl/v1/doc_service.js | 82 +- .../v1/doc/google/cloud/automl/v1/doc_text.js | 96 + .../cloud/automl/v1/doc_text_extraction.js | 82 + .../cloud/automl/v1/doc_text_segment.js | 39 + .../cloud/automl/v1/doc_text_sentiment.js | 84 + .../src/v1/prediction_service_client.js | 218 +- .../v1/prediction_service_client_config.json | 5 + .../automl/v1beta1/doc_classification.js | 15 +- .../google/cloud/automl/v1beta1/doc_image.js | 12 +- .../doc/google/cloud/automl/v1beta1/doc_io.js | 7 +- .../google/cloud/automl/v1beta1/doc_tables.js | 8 + .../google/cloud/automl/v1beta1/doc_text.js | 17 +- packages/google-cloud-automl/synth.metadata | 12 +- packages/google-cloud-automl/test/gapic-v1.js | 478 + 60 files changed, 35089 insertions(+), 7782 deletions(-) create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto create mode 100644 packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_spec.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_classification.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_detection.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_geometry.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_image.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_extraction.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_segment.js create mode 100644 packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_sentiment.js diff --git a/packages/google-cloud-automl/.nycrc b/packages/google-cloud-automl/.nycrc index 23e322204ec..367688844eb 100644 --- a/packages/google-cloud-automl/.nycrc +++ b/packages/google-cloud-automl/.nycrc @@ -10,7 +10,6 @@ "**/docs", "**/samples", "**/scripts", - "**/src/**/v*/**/*.js", "**/protos", "**/test", ".jsdoc.js", diff --git a/packages/google-cloud-automl/README.md b/packages/google-cloud-automl/README.md index 2bfd7c494bc..d4b4e839736 100644 --- a/packages/google-cloud-automl/README.md +++ b/packages/google-cloud-automl/README.md @@ -111,7 +111,6 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Quickstart | [source code](https://github.com/googleapis/nodejs-automl/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-automl&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Set Endpoint | [source code](https://github.com/googleapis/nodejs-automl/blob/master/samples/beta/setEndpoint.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-automl&page=editor&open_in_editor=samples/beta/setEndpoint.js,samples/README.md) | diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto index 9469c2618a4..346ec8b938e 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto @@ -17,12 +17,16 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -35,5 +39,30 @@ message AnnotationPayload { oneof detail { // Annotation details for translation. TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto new file mode 100644 index 00000000000..6cd8c7965fa --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A definition of an annotation spec. +message AnnotationSpec { + // Output only. Resource name of the annotation spec. + // Form: + // + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. + // The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + // (_), and ASCII digits 0-9. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto new file mode 100644 index 00000000000..75abeacbd68 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto @@ -0,0 +1,172 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Model evaluation metrics for classification problems. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of + // [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] + // and + // [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the + // [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + // field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto index d5337ac57ec..60ee9229a60 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto @@ -17,39 +17,184 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/geometry.proto"; import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/text_segment.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; -import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; option ruby_package = "Google::Cloud::AutoML::V1"; +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + // A representation of a text snippet. message TextSnippet { // Required. The content of the text snippet as a string. Up to 250000 // characters long. string content = 1; - // Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed - // values are "text/html" and "text/plain". If left blank, the format is - // automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + // Optional. The format of + // [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only + // two allowed values are "text/html" and "text/plain". If left blank, the + // format is automatically determined from the type of the uploaded + // [content][google.cloud.automl.v1.TextSnippet.content]. string mime_type = 2; // Output only. HTTP URI where you can download the content. string content_uri = 4; } +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the + // document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // the original document, starts from 1. + int32 page_number = 2; + + // The position of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // the page. Contains exactly 4 + // + // [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the + // [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in + // document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + // Example data used for training or prediction. message ExamplePayload { - // Required. Input only. The example data. + // Required. The example data. oneof payload { + // Example image. + Image image = 1; + // Example text. TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; } } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto index 73b7d6027d0..6e0961b38ac 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto @@ -17,12 +17,15 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -36,6 +39,21 @@ message Dataset { oneof dataset_metadata { // Metadata for a dataset used for translation. TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; } // Output only. The resource name of the dataset. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto new file mode 100644 index 00000000000..d5559346814 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto @@ -0,0 +1,88 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/geometry.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent + // example, value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto new file mode 100644 index 00000000000..99bf9134b58 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto @@ -0,0 +1,48 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto new file mode 100644 index 00000000000..a6f27873561 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto @@ -0,0 +1,194 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata {} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud`(default), the train budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192, 000 + // which represents one day in wall time. For model type + // `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + // `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + // `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + // and 100,000 milli node hours, inclusive. The default value is 24, 000 which + // represents one day in wall time. + int64 train_budget_milli_node_hours = 16; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 17; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. Expected to have low latency, but may have lower + // prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile or edge device with TensorFlow + // afterwards. Expected to have a higher latency, but should + // also have a higher prediction quality than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. Expected + // to have low latency, but may have lower prediction quality + // than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) + // and used on a mobile device with Core ML afterwards. Expected + // to have a higher latency, but should also have a higher + // prediction quality than other models. + string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + string model_type = 1; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto index fd835d250e6..98a694a64ce 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto @@ -18,28 +18,451 @@ syntax = "proto3"; package google.cloud.automl.v1; import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; option ruby_package = "Google::Cloud::AutoML::V1"; -// Input configuration for ImportData Action. +// Input configuration for +// [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action. // // The format of input depends on dataset_metadata the Dataset into which // the import is happening has. As input source the -// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] // is expected, unless specified otherwise. Additionally any input .CSV file // by itself must be 100MB or smaller, unless specified otherwise. // If an "example" file (that is, image, video etc.) with identical content -// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then +// (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then // its label, bounding boxes etc. are appended. The same file should be always -// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then +// provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then // these values are nondeterministically selected from the given ones. // -// Errors: +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +//

AutoML Vision

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/vision/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, +// .TIFF, .ICO. +// +// * `LABEL` - A label that identifies the object in the image. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no `LABEL`. +// +// Some sample rows: +// +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// +//
Object Detection
+// See [Preparing your training +// data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) +// for more information. +// +// A CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image +// is assumed to be exhaustively labeled. +// +// * `LABEL` - A label that identifies the object in the image specified by the +// `BOUNDING_BOX`. +// +// * `BOUNDING BOX` - The vertices of an object in the example image. +// The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than +// 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` +// per line). If an image has no looked for objects then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// `BOUNDING_BOX`. +// +// **Four sample rows:** +// +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +//
+//
+// +// +//

AutoML Natural Language

+// +// +//
Entity Extraction
+// +// See [Preparing your training +// data](/natural-language/automl/entity-analysis/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,GCS_FILE_PATH +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing.. +// +// * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in +// Google Cloud Storage that contains in-line text in-line as documents +// for model training. +// +// After the training data set has been determined from the `TRAIN` and +// `UNASSIGNED` CSV files, the training data is divided into train and +// validation data sets. 70% for training and 30% for validation. +// +// For example: +// +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// +// **In-line JSONL files** +// +// In-line .JSONL files contain, per line, a JSON document that wraps a +// [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by +// one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] +// fields, which have `display_name` and `text_extraction` fields to describe +// the entity from the text snippet. Multiple JSON documents can be separated +// using line breaks (\n). +// +// The supplied text must be annotated exhaustively. For example, if you +// include the text "horse", but do not label it as "animal", +// then "horse" is assumed to not be an "animal". +// +// Any given text snippet content must have 30,000 characters or +// less, and also be UTF-8 NFC encoded. ASCII is accepted as it is +// UTF-8 NFC encoded. +// +// For example: +// +// { +// "text_snippet": { +// "content": "dog car cat" +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 2} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 6} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 10} +// } +// } +// ] +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 7} +// } +// } +// ] +// } +// +// **JSONL files that reference documents** +// +// .JSONL files contain, per line, a JSON document that wraps a +// `input_config` that contains the path to a source PDF document. +// Multiple JSON documents can be separated using line breaks (\n). +// +// For example: +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// **In-line JSONL files with PDF layout information** +// +// **Note:** You can only annotate PDF files using the UI. The format described +// below applies to annotated PDF files exported using the UI or `exportData`. +// +// In-line .JSONL files for PDF documents contain, per line, a JSON document +// that wraps a `document` field that provides the textual content of the PDF +// document and the layout information. +// +// For example: +// +// { +// "document": { +// "document_text": { +// "content": "dog car cat" +// } +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 11, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 3, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 3} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 7} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 11} +// } +// }, +// ], +// +// +// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 10MB or +// less in size. For zip files, the size of each file inside the zip must be +// 10MB or less in size. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed. +// The `ML_USE` and `LABEL` columns are optional. +// Supported file extensions: .TXT, .PDF, .ZIP +// +// A maximum of 100 unique labels are allowed per CSV row. +// +// Sample rows: +// +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// gs://folder/content.txt,SlowService +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,BadFood +// +// +// +//
Sentiment Analysis
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 128kB or +// less in size. For zip files, the size of each file inside the zip must be +// 128kB or less in size. +// +// The `ML_USE` and `SENTIMENT` columns are optional. +// Supported file extensions: .TXT, .PDF, .ZIP +// +// * `SENTIMENT` - An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one - +// it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// large. +// +// Sample rows: +// +// TRAIN,"@freewrytin this is way too good for your product",2 +// gs://folder/content.txt,3 +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,2 +//
+//
+// +// +// **Input field definitions:** +// +// `ML_USE` +// : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/image1.png". +// +// `LABEL` +// : A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// +// `BOUNDING_BOX` +// : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// +// `VERTEX` +// : (`COORDINATE,COORDINATE`) +// First coordinate is horizontal (x), the second is vertical (y). +// +// `COORDINATE` +// : A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// +// `TEXT_SNIPPET` +// : The content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// +// `DOCUMENT` +// : A field that provides the textual content with document and the layout +// information. +// +// +// **Errors:** +// // If any of the provided CSV files can't be parsed or if more than certain // percent of CSV rows cannot be processed then the operation fails and // nothing is imported. Regardless of overall success or failure the per-row @@ -50,8 +473,9 @@ message InputConfig { // The source of the input. oneof source { // The Google Cloud Storage location for the input content. - // In ImportData, the gcs_source points to a csv with structure described in - // the comment. + // For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], + // `gcs_source` points to a CSV file with a structure described in + // [InputConfig][google.cloud.automl.v1.InputConfig]. GcsSource gcs_source = 1; } @@ -61,40 +485,392 @@ message InputConfig { map params = 2; } -// * For Translation: +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +//

AutoML Natural Language

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF +// Text files can be no larger than 10MB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// +//
Sentiment Analysis
+// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF +// Text files can be no larger than 128kB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// +//
Entity Extraction
+// +// One or more JSONL (JSON Lines) files that either provide inline text or +// documents. You can only use one format, either inline text or documents, +// for a single call to [AutoMl.BatchPredict]. +// +// Each JSONL file contains a per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// JSON representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// +// Each document JSONL file contains, per line, a proto that wraps a +// Document proto with `input_config` set. Only PDF documents are +// currently supported, and each PDF document cannot exceed 2MB in size. +// +// Each JSONL file must not exceed 100MB in size, and no more than 20 +// JSONL files may be passed. +// +// Sample inline JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "Extended sample content", +// "mime_type": "text/plain" +// } +// } +// +// Sample document JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +//
+//
+// +// **Input field definitions:** +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/video.avi". +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // The source of the input. + oneof source { + // Required. The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // + // Max supported size: 512MB. + // + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// Output configuration for ExportData. +// +// As destination the +// [gcs_destination][google.cloud.automl.v1.OutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be "export_data--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. +// Only ground truth annotations are exported (not approved annotations are +// not exported). +// +// The outputs correspond to how the data was imported, and may be used as +// input to import data. The output formats are represented as EBNF with literal +// commas and same non-terminal symbols definitions are these in import data's +// [InputConfig][google.cloud.automl.v1.InputConfig]: +// +// * For Image Classification: +// CSV file(s) `image_classification_1.csv`, +// `image_classification_2.csv`,...,`image_classification_N.csv`with +// each line in format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// where GCS_FILE_PATHs point at the original, source locations of the +// imported images. +// For MULTICLASS classification type, there can be at most one LABEL +// per example. +// +// * For Image Object Detection: +// CSV file(s) `image_object_detection_1.csv`, +// `image_object_detection_2.csv`,...,`image_object_detection_N.csv` +// with each line in format: +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// where GCS_FILE_PATHs point at the original, source locations of the +// imported images. +// +// * For Text Classification: +// In the created directory CSV file(s) `text_classification_1.csv`, +// `text_classification_2.csv`, ...,`text_classification_N.csv` will be +// created where N depends on the total number of examples exported. +// Each line in the CSV is of the format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// where GCS_FILE_PATHs point at the exported .txt files containing +// the text content of the imported example. For MULTICLASS +// classification type, there will be at most one LABEL per example. +// +// * For Text Sentiment: +// In the created directory CSV file(s) `text_sentiment_1.csv`, +// `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be +// created where N depends on the total number of examples exported. +// Each line in the CSV is of the format: +// ML_USE,GCS_FILE_PATH,SENTIMENT +// where GCS_FILE_PATHs point at the exported .txt files containing +// the text content of the imported example. +// +// * For Text Extraction: +// CSV file `text_extraction.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which +// contains, per line, a proto that wraps a TextSnippet proto (in json +// representation) followed by AnnotationPayload protos (called +// annotations). If initially documents had been imported, the JSONL +// will point at the original, source locations of the imported +// documents. +// +// * For Translation: // CSV file `translation.csv`, with each line in format: // ML_USE,GCS_FILE_PATH // GCS_FILE_PATH leads to a .TSV file which describes examples that have // given ML_USE, using the following row format per line: // TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target // language) -// -// `export_data__` -// where will be made -// BigQuery-dataset-name compatible (e.g. most special characters will -// become underscores), and timestamp will be in -// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that -// dataset a new table called `primary_table` will be created, and -// filled with precisely the same data as this obtained on import. message OutputConfig { - // Required. The destination of the output. + // The destination of the output. oneof destination { - // The Google Cloud Storage location where the output is to be written to. - // For Image Object Detection, Text Extraction, Video Classification and - // Tables, in the given directory a new directory will be created with name: + // Required. The Google Cloud Storage location where the output is to be + // written to. For Image Object Detection, Text Extraction in the given + // directory a new directory will be created with name: // export_data-- where // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export // output will be written into that directory. - GcsDestination gcs_destination = 1; + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; } } +// Output configuration for BatchPredict Action. +// +// As destination the +// +// [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text (or pdf) file in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text (or pdf) file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text (or pdf) file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text (or pdf) file followed by exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text (or pdf) file in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text (or pdf) file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text (or pdf) file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text (or pdf) file followed by exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +message BatchPredictOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location of the directory where the + // output is to be written to. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the model is to be + // written to. This location may only be set for the following model + // formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript.x` + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + map params = 2; +} + // The Google Cloud Storage location for the input content. message GcsSource { - // Required. Google Cloud Storage URIs to input files, up to 2000 characters - // long. Accepted forms: + // Required. Google Cloud Storage URIs to input files, up to 2000 + // characters long. Accepted forms: // * Full object path, e.g. gs://bucket/directory/object.csv - repeated string input_uris = 1; + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; } // The Google Cloud Storage location where the output is to be written to. @@ -105,5 +881,5 @@ message GcsDestination { // * Prefix path: gs://bucket/directory // The requesting user must have write permission to the bucket. // The directory is created if it doesn't exist. - string output_uri_prefix = 1; + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto index 5f820b42001..51ca90425b6 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto @@ -17,12 +17,15 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -30,6 +33,11 @@ option ruby_package = "Google::Cloud::AutoML::V1"; // API proto representing a trained machine learning model. message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project_id}/locations/{location_id}/models/{model_id}" + }; + // Deployment state of the model. enum DeploymentState { // Should not be used, an un-set enum has this value by default. @@ -48,6 +56,21 @@ message Model { oneof model_metadata { // Metadata for translation models. TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; } // Output only. Resource name of the model. @@ -74,6 +97,10 @@ message Model { // prediction requests after it gets deployed. DeploymentState deployment_state = 8; + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 10; + // Optional. The labels with user-defined metadata to organize your model. // // Label keys and values can be no longer than 64 characters diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto index fe9df1b9488..149fa4e87d9 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto @@ -17,12 +17,17 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; import "google/cloud/automl/v1/translation.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -32,8 +37,21 @@ option ruby_package = "Google::Cloud::AutoML::V1"; message ModelEvaluation { // Output only. Problem type specific evaluation metrics. oneof metrics { + // Model evaluation metrics for image, text classification. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + // Model evaluation metrics for translation. TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics + image_object_detection_evaluation_metrics = 12; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; } // Output only. Resource name of the model evaluation. @@ -42,10 +60,18 @@ message ModelEvaluation { // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` string name = 1; - // Output only. The ID of the annotation spec that the model evaluation applies to. The - // The ID is empty for the overall model evaluation. + // Output only. The ID of the annotation spec that the model evaluation + // applies to. The The ID is empty for the overall model evaluation. string annotation_spec_id = 2; + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // at the moment when the model was trained. Because this field returns a + // value at model training time, for different models trained from the same + // dataset, the values may differ, since display names could had been changed + // between the two model's trainings. + string display_name = 15; + // Output only. Timestamp when this model evaluation was created. google.protobuf.Timestamp create_time = 5; @@ -57,6 +83,6 @@ message ModelEvaluation { // Otherwise, this is the count of examples that according to the ground // truth were annotated by the // - // [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + // [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. int32 evaluated_example_count = 6; } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto index 575fd8a4c9e..7c09d6ecd34 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto @@ -17,16 +17,19 @@ syntax = "proto3"; package google.cloud.automl.v1; +import "google/cloud/automl/v1/dataset.proto"; import "google/cloud/automl/v1/io.proto"; import "google/cloud/automl/v1/model.proto"; import "google/cloud/automl/v1/model_evaluation.proto"; +import "google/cloud/automl/v1/prediction_service.proto"; +import "google/cloud/automl/v1/service.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; import "google/api/annotations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_package = "com.google.cloud.automl.v1"; option php_namespace = "Google\\Cloud\\AutoML\\V1"; @@ -40,8 +43,29 @@ message OperationMetadata { // Details of a Delete operation. DeleteOperationMetadata delete_details = 8; + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + // Details of CreateModel operation. CreateModelOperationMetadata create_model_details = 10; + + // Details of CreateDataset operation. + CreateDatasetOperationMetadata create_dataset_details = 30; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; } // Output only. Progress of operation. Range: [0, 100]. @@ -66,7 +90,84 @@ message DeleteOperationMetadata { } +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateDataset operation. +message CreateDatasetOperationMetadata { + +} + // Details of CreateModel operation. message CreateModelOperationMetadata { } + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // + // [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto index a5f02873d39..0628dbaac43 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto @@ -19,14 +19,14 @@ package google.cloud.automl.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/resource.proto"; import "google/cloud/automl/v1/annotation_payload.proto"; import "google/cloud/automl/v1/data_items.proto"; import "google/cloud/automl/v1/io.proto"; -import "google/cloud/automl/v1/operations.proto"; import "google/longrunning/operations.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "PredictionServiceProto"; option java_package = "com.google.cloud.automl.v1"; @@ -45,14 +45,43 @@ service PredictionService { // Perform an online prediction. The prediction result will be directly // returned in the response. // Available for following ML problems, and their expected request payloads: + // * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Text Classification - TextSnippet, content up to 60,000 characters, + // UTF-8 encoded. + // * Text Extraction - TextSnippet, content up to 30,000 characters, + // UTF-8 NFC encoded. // * Translation - TextSnippet, content up to 25,000 characters, UTF-8 // encoded. + // * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + // encoded. rpc Predict(PredictRequest) returns (PredictResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/models/*}:predict" body: "*" }; } + + // Perform a batch prediction. Unlike the online + // [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, + // [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned + // in the [response][google.longrunning.Operation.response] field. Available + // for following ML problems: + // * Image Classification + // * Image Object Detection + // * Text Extraction + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + } } // Request message for @@ -67,6 +96,20 @@ message PredictRequest { // Additional domain-specific parameters, any string must be up to 25000 // characters long. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned in the response. Default is 100, the + // requested value may be limited by server. map params = 3; } @@ -77,6 +120,87 @@ message PredictResponse { // Translation and Text Sentiment will return precisely one payload. repeated AnnotationPayload payload = 1; + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // * For Text Extraction: + // If the input is a .pdf file, the OCR'ed text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + // + // * For Text Classification: + // If the input is a .pdf file, the OCR'ed trucated text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + // + // * For Text Sentiment: + // If the input is a .pdf file, the OCR'ed trucated text will be provided in + // [document_text][google.cloud.automl.v1.Document.document_text]. + ExamplePayload preprocessed_input = 3; + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Text Sentiment: + // `sentiment_score` - (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 will be also positive (though + // the least). + // The sentiment_score shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. map metadata = 2; } + +// Request message for +// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Name of the model requested to serve the batch prediction. + string name = 1; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4; + + // Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // * For Text Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be produced per image. Default is 100, the + // requested value may be limited by server. + map params = 5; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the +// [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + map metadata = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto index c994d95bfec..5cd9065bdba 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto @@ -19,17 +19,19 @@ package google.cloud.automl.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/resource.proto"; import "google/cloud/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; import "google/cloud/automl/v1/dataset.proto"; +import "google/cloud/automl/v1/image.proto"; import "google/cloud/automl/v1/io.proto"; import "google/cloud/automl/v1/model.proto"; import "google/cloud/automl/v1/model_evaluation.proto"; -import "google/cloud/automl/v1/operations.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "AutoMlProto"; option java_package = "com.google.cloud.automl.v1"; @@ -116,6 +118,14 @@ service AutoMl { }; } + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) + returns (google.cloud.automl.v1.AnnotationSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + } + // Creates a model. // Returns a Model in the [response][google.longrunning.Operation.response] // field when it completes. @@ -161,6 +171,54 @@ service AutoMl { }; } + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // + // [node_number][google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection; all other + // domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + } + // Gets a model evaluation. rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { option (google.api.http) = { @@ -203,8 +261,8 @@ message ListDatasetsRequest { // An expression for filtering the results of the request. // // * `dataset_metadata` - for existence of the case (e.g. - // image_classification_dataset_metadata:*). - // Some examples of using the filter are: + // image_classification_dataset_metadata:*). Some examples of + // using the filter are: // // * `translation_dataset_metadata:*` --> The dataset has // translation_dataset_metadata. @@ -274,6 +332,13 @@ message ExportDataRequest { OutputConfig output_config = 3; } +// Request message for +// [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // The resource name of the annotation spec to retrieve. + string name = 1; +} + // Request message for // [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. message CreateModelRequest { @@ -300,7 +365,7 @@ message ListModelsRequest { // An expression for filtering the results of the request. // // * `model_metadata` - for existence of the case (e.g. - // video_classification_model_metadata:*). + // image_classification_model_metadata:*). // * `dataset_id` - for = or !=. Some examples of using the filter are: // // * `image_classification_model_metadata:*` --> The model has @@ -349,6 +414,42 @@ message UpdateModelRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for +// [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata + image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata + image_classification_model_deployment_metadata = 4; + } + + // Resource name of the model to deploy. + string name = 1; +} + +// Request message for +// [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Resource name of the model to undeploy. + string name = 1; +} + +// Request message for +// [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. Models need +// to be enabled for exporting, otherwise an error code will be returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3; +} + // Request message for // [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. message GetModelEvaluationRequest { diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto new file mode 100644 index 00000000000..7c47d9b35f6 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto @@ -0,0 +1,60 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata {} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata {} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher + // value means a more positive sentiment. The range of sentiments that will be + // used is between 0 and sentiment_max (inclusive on both ends), and all the + // values in the range must be represented in the dataset before a model can + // be created. sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata {} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto new file mode 100644 index 00000000000..f7e10ca895f --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto @@ -0,0 +1,70 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/cloud/automl/v1/text_segment.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto new file mode 100644 index 00000000000..cb75fc040aa --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto @@ -0,0 +1,43 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto new file mode 100644 index 00000000000..f87f300bf8d --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto @@ -0,0 +1,79 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.automl.v1; + +import "google/api/annotations.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoML\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when + // populating the dataset from which the model used for the prediction had + // been trained. The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto index bc449fe79f5..bb67e3d4637 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto @@ -17,11 +17,12 @@ syntax = "proto3"; package google.cloud.automl.v1; -import "google/cloud/automl/v1/data_items.proto"; import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/data_items.proto"; -option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl"; option java_multiple_files = true; option java_outer_classname = "TranslationProto"; option java_package = "com.google.cloud.automl.v1"; @@ -31,10 +32,10 @@ option ruby_package = "Google::Cloud::AutoML::V1"; // Dataset metadata that is specific to translation. message TranslationDatasetMetadata { // Required. The BCP-47 language code of the source language. - string source_language_code = 1; + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The BCP-47 language code of the target language. - string target_language_code = 2; + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; } // Evaluation metrics for the dataset. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto index 7e54238e033..c8475542a72 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; -import "google/cloud/automl/v1beta1/temporal.proto"; import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_outer_classname = "ClassificationProto"; @@ -126,7 +126,10 @@ message ClassificationEvaluationMetrics { // for each example. float false_positive_rate_at1 = 9; - // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + // Output only. The harmonic mean of + // [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] + // and + // [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. float f1_score_at1 = 7; // Output only. The number of model created labels that match a ground truth @@ -153,7 +156,9 @@ message ClassificationEvaluationMetrics { // Output only. Value of the specific cell in the confusion matrix. // The number of values each row has (i.e. the length of the row) is equal // to the length of the `annotation_spec_id` field or, if that one is not - // populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + // populated, length of the + // [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] + // field. repeated int32 example_count = 1; } @@ -175,9 +180,9 @@ message ClassificationEvaluationMetrics { // Output only. Rows in the confusion matrix. The number of rows is equal to // the size of `annotation_spec_id`. - // `row[i].value[j]` is the number of examples that have ground truth of the - // `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by - // the model being evaluated. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. repeated Row row = 2; } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto index fdbea7042d8..424a0c64f07 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto @@ -35,9 +35,11 @@ option ruby_package = "Google::Cloud::AutoML::V1beta1"; // Only images up to 30MB in size are supported. message Image { // Input only. The data representing the image. - // For Predict calls [image_bytes][] must be set, as other options are not - // currently supported by prediction API. You can read the contents of an - // uploaded image by using the [content_uri][] field. + // For Predict calls + // [image_bytes][google.cloud.automl.v1beta1.Image.image_bytes] must be set, + // as other options are not currently supported by prediction API. You can + // read the contents of an uploaded image by using the + // [content_uri][google.cloud.automl.v1beta1.Image.content_uri] field. oneof data { // Image content represented as a stream of bytes. // Note: As with all `bytes` fields, protobuffers use a pure binary diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto index 61e48d12e1f..5995efc6eef 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto @@ -98,6 +98,15 @@ message ImageClassificationModelMetadata { // to have a higher latency, but should also have a higher // prediction quality than other models. string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; } // Model metadata specific to image object detection. @@ -132,7 +141,7 @@ message ImageObjectDetectionModelMetadata { // full budget and the stop_reason will be `MODEL_CONVERGED`. // Note, node_hour = actual_hour * number_of_nodes_invovled. // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - // the train budget must be between 20,000 and 2,000,000 milli node hours, + // the train budget must be between 20,000 and 900,000 milli node hours, // inclusive. The default value is 216, 000 which represents one day in // wall time. // For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -153,7 +162,8 @@ message ImageClassificationModelDeploymentMetadata { // Input only. The number of nodes to deploy the model on. A node is an // abstraction of a machine resource, which can handle online prediction QPS // as given in the model's - // [node_qps][google.cloud.automl.v1p1beta.ImageClassificationModelMetadata.node_qps]. + // + // [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. // Must be between 1 and 100, inclusive on both ends. int64 node_count = 1; } diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto index 6f007f02a10..5cc61c5ea30 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto @@ -986,7 +986,7 @@ message ModelExportOutputConfig { oneof destination { // The Google Cloud Storage location where the model is to be written to. // This location may only be set for the following model formats: - // "tflite", "edgetpu_tflite", "core_ml", "docker". + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". // // Under the directory given as the destination a new one with name // "model-export--", @@ -1010,7 +1010,8 @@ message ModelExportOutputConfig { // // * For Image Classification mobile-low-latency-1, mobile-versatile-1, // mobile-high-accuracy-1: - // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker". + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". // // * For Image Classification mobile-core-ml-low-latency-1, // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: @@ -1021,6 +1022,8 @@ message ModelExportOutputConfig { // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) // devices. // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. // * docker - Used for Docker containers. Use the params field to customize // the container. The container is verified to work correctly on // ubuntu 16.04 operating system. See more at diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto index aba18cd6715..c835aba3df8 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto @@ -17,13 +17,13 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; +import "google/api/annotations.proto"; import "google/cloud/automl/v1beta1/io.proto"; import "google/cloud/automl/v1beta1/model.proto"; import "google/cloud/automl/v1beta1/model_evaluation.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -61,7 +61,8 @@ message OperationMetadata { ExportModelOperationMetadata export_model_details = 22; // Details of ExportEvaluatedExamples operation. - ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = 26; + ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = + 26; } // Output only. Progress of operation. Range: [0, 100]. @@ -82,29 +83,19 @@ message OperationMetadata { } // Details of operations that perform deletes of any entities. -message DeleteOperationMetadata { - -} +message DeleteOperationMetadata {} // Details of DeployModel operation. -message DeployModelOperationMetadata { - -} +message DeployModelOperationMetadata {} // Details of UndeployModel operation. -message UndeployModelOperationMetadata { - -} +message UndeployModelOperationMetadata {} // Details of CreateModel operation. -message CreateModelOperationMetadata { - -} +message CreateModelOperationMetadata {} // Details of ImportData operation. -message ImportDataOperationMetadata { - -} +message ImportDataOperationMetadata {} // Details of ExportData operation. message ExportDataOperationMetadata { diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto index c8b7809b6cf..467a330c8cf 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; +import "google/api/annotations.proto"; import "google/cloud/automl/v1beta1/classification.proto"; import "google/cloud/automl/v1beta1/column_spec.proto"; import "google/cloud/automl/v1beta1/data_items.proto"; @@ -25,7 +26,6 @@ import "google/cloud/automl/v1beta1/ranges.proto"; import "google/cloud/automl/v1beta1/temporal.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -103,6 +103,19 @@ message TablesDatasetMetadata { // Model metadata specific to AutoML Tables. message TablesModelMetadata { + // Additional optimization objective configuration. Required for + // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 17; + + // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 18; + } + // Column spec of the dataset's primary table's column the model is // predicting. Snapshotted when model creation started. // Only 3 fields are used: diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto index 6a01b7cff60..ca722e07c96 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto @@ -17,8 +17,8 @@ syntax = "proto3"; package google.cloud.automl.v1beta1; -import "google/cloud/automl/v1beta1/classification.proto"; import "google/api/annotations.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl"; option java_multiple_files = true; @@ -35,31 +35,25 @@ message TextClassificationDatasetMetadata { // Model metadata that is specific to text classification. message TextClassificationModelMetadata { - + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; } // Dataset metadata that is specific to text extraction -message TextExtractionDatasetMetadata { - -} +message TextExtractionDatasetMetadata {} // Model metadata that is specific to text extraction. -message TextExtractionModelMetadata { - -} +message TextExtractionModelMetadata {} // Dataset metadata for text sentiment. message TextSentimentDatasetMetadata { - // Required. A sentiment is expressed as an integer ordinal, where higher value - // means a more positive sentiment. The range of sentiments that will be used - // is between 0 and sentiment_max (inclusive on both ends), and all the values - // in the range must be represented in the dataset before a model can be - // created. - // sentiment_max value must be between 1 and 10 (inclusive). + // Required. A sentiment is expressed as an integer ordinal, where higher + // value means a more positive sentiment. The range of sentiments that will be + // used is between 0 and sentiment_max (inclusive on both ends), and all the + // values in the range must be represented in the dataset before a model can + // be created. sentiment_max value must be between 1 and 10 (inclusive). int32 sentiment_max = 1; } // Model metadata that is specific to text sentiment. -message TextSentimentModelMetadata { - -} +message TextSentimentModelMetadata {} diff --git a/packages/google-cloud-automl/protos/protos.d.ts b/packages/google-cloud-automl/protos/protos.d.ts index bb21584de8c..00fb8005d50 100644 --- a/packages/google-cloud-automl/protos/protos.d.ts +++ b/packages/google-cloud-automl/protos/protos.d.ts @@ -1,3 +1,18 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +import * as Long from "long"; import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { @@ -11,3932 +26,9574 @@ export namespace google { /** Namespace v1. */ namespace v1 { - /** Represents an AutoMl */ - class AutoMl extends $protobuf.rpc.Service { + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata deleteDetails */ + deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails */ + deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails */ + undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails */ + createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails */ + createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails */ + importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails */ + batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails */ + exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails */ + exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { /** - * Constructs a new AutoMl service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new OperationMetadata. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.automl.v1.IOperationMetadata); + + /** OperationMetadata deleteDetails. */ + public deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails. */ + public deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails. */ + public undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails. */ + public createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails. */ + public createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails. */ + public importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails. */ + public batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails. */ + public exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails. */ + public exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata details. */ + public details?: ("deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"); /** - * Creates new AutoMl 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. + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AutoMl; + public static create(properties?: google.cloud.automl.v1.IOperationMetadata): google.cloud.automl.v1.OperationMetadata; /** - * Calls CreateDataset. - * @param request CreateDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.CreateDatasetCallback): void; + public static encode(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateDataset. - * @param request CreateDatasetRequest message or plain object - * @returns Promise + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest): Promise; + public static encodeDelimited(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetDataset. - * @param request GetDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Dataset + * 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 getDataset(request: google.cloud.automl.v1.IGetDatasetRequest, callback: google.cloud.automl.v1.AutoMl.GetDatasetCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.OperationMetadata; /** - * Calls GetDataset. - * @param request GetDatasetRequest message or plain object - * @returns Promise + * 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 getDataset(request: google.cloud.automl.v1.IGetDatasetRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.OperationMetadata; /** - * Calls ListDatasets. - * @param request ListDatasetsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest, callback: google.cloud.automl.v1.AutoMl.ListDatasetsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListDatasets. - * @param request ListDatasetsRequest message or plain object - * @returns Promise + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata */ - public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OperationMetadata; /** - * Calls UpdateDataset. - * @param request UpdateDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Dataset + * 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 updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.UpdateDatasetCallback): void; + public static toObject(message: google.cloud.automl.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateDataset. - * @param request UpdateDatasetRequest message or plain object - * @returns Promise + * Converts this OperationMetadata to JSON. + * @returns JSON object */ - public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationMetadata. */ + interface IDeleteOperationMetadata { + } + + /** Represents a DeleteOperationMetadata. */ + class DeleteOperationMetadata implements IDeleteOperationMetadata { /** - * Calls DeleteDataset. - * @param request DeleteDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new DeleteOperationMetadata. + * @param [properties] Properties to set */ - public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest, callback: google.cloud.automl.v1.AutoMl.DeleteDatasetCallback): void; + constructor(properties?: google.cloud.automl.v1.IDeleteOperationMetadata); /** - * Calls DeleteDataset. - * @param request DeleteDatasetRequest message or plain object - * @returns Promise + * Creates a new DeleteOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationMetadata instance */ - public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest): Promise; + public static create(properties?: google.cloud.automl.v1.IDeleteOperationMetadata): google.cloud.automl.v1.DeleteOperationMetadata; /** - * Calls ImportData. - * @param request ImportDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public importData(request: google.cloud.automl.v1.IImportDataRequest, callback: google.cloud.automl.v1.AutoMl.ImportDataCallback): void; + public static encode(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ImportData. - * @param request ImportDataRequest message or plain object - * @returns Promise + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public importData(request: google.cloud.automl.v1.IImportDataRequest): Promise; + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ExportData. - * @param request ExportDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public exportData(request: google.cloud.automl.v1.IExportDataRequest, callback: google.cloud.automl.v1.AutoMl.ExportDataCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteOperationMetadata; /** - * Calls ExportData. - * @param request ExportDataRequest message or plain object - * @returns Promise + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public exportData(request: google.cloud.automl.v1.IExportDataRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteOperationMetadata; /** - * Calls CreateModel. - * @param request CreateModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies a DeleteOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createModel(request: google.cloud.automl.v1.ICreateModelRequest, callback: google.cloud.automl.v1.AutoMl.CreateModelCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateModel. - * @param request CreateModelRequest message or plain object - * @returns Promise + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationMetadata */ - public createModel(request: google.cloud.automl.v1.ICreateModelRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteOperationMetadata; /** - * Calls GetModel. - * @param request GetModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteOperationMetadata + * @param [options] Conversion options + * @returns Plain object */ - public getModel(request: google.cloud.automl.v1.IGetModelRequest, callback: google.cloud.automl.v1.AutoMl.GetModelCallback): void; + public static toObject(message: google.cloud.automl.v1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetModel. - * @param request GetModelRequest message or plain object - * @returns Promise + * Converts this DeleteOperationMetadata to JSON. + * @returns JSON object */ - public getModel(request: google.cloud.automl.v1.IGetModelRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeployModelOperationMetadata. */ + interface IDeployModelOperationMetadata { + } + + /** Represents a DeployModelOperationMetadata. */ + class DeployModelOperationMetadata implements IDeployModelOperationMetadata { /** - * Calls ListModels. - * @param request ListModelsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListModelsResponse + * Constructs a new DeployModelOperationMetadata. + * @param [properties] Properties to set */ - public listModels(request: google.cloud.automl.v1.IListModelsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelsCallback): void; + constructor(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata); /** - * Calls ListModels. - * @param request ListModelsRequest message or plain object - * @returns Promise + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelOperationMetadata instance */ - public listModels(request: google.cloud.automl.v1.IListModelsRequest): Promise; + public static create(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata): google.cloud.automl.v1.DeployModelOperationMetadata; /** - * Calls DeleteModel. - * @param request DeleteModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest, callback: google.cloud.automl.v1.AutoMl.DeleteModelCallback): void; + public static encode(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteModel. - * @param request DeleteModelRequest message or plain object - * @returns Promise + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest): Promise; + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateModel. - * @param request UpdateModelRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Model + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest, callback: google.cloud.automl.v1.AutoMl.UpdateModelCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeployModelOperationMetadata; /** - * Calls UpdateModel. - * @param request UpdateModelRequest message or plain object - * @returns Promise + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeployModelOperationMetadata; /** - * Calls GetModelEvaluation. - * @param request GetModelEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ModelEvaluation + * Verifies a DeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetModelEvaluation. - * @param request GetModelEvaluationRequest message or plain object - * @returns Promise + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelOperationMetadata */ - public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelOperationMetadata; /** - * Calls ListModelEvaluations. - * @param request ListModelEvaluationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object */ - public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback): void; + public static toObject(message: google.cloud.automl.v1.DeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListModelEvaluations. - * @param request ListModelEvaluationsRequest message or plain object - * @returns Promise + * Converts this DeployModelOperationMetadata to JSON. + * @returns JSON object */ - public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace AutoMl { + /** Properties of an UndeployModelOperationMetadata. */ + interface IUndeployModelOperationMetadata { + } + + /** Represents an UndeployModelOperationMetadata. */ + class UndeployModelOperationMetadata implements IUndeployModelOperationMetadata { /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#createDataset}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new UndeployModelOperationMetadata. + * @param [properties] Properties to set */ - type CreateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata); /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getDataset}. - * @param error Error, if any - * @param [response] Dataset + * Creates a new UndeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelOperationMetadata instance */ - type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + public static create(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata): google.cloud.automl.v1.UndeployModelOperationMetadata; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listDatasets}. - * @param error Error, if any - * @param [response] ListDatasetsResponse + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListDatasetsResponse) => void; + public static encode(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateDataset}. - * @param error Error, if any - * @param [response] Dataset + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteDataset}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UndeployModelOperationMetadata; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#importData}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UndeployModelOperationMetadata; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportData}. - * @param error Error, if any - * @param [response] Operation + * Verifies an UndeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#createModel}. - * @param error Error, if any - * @param [response] Operation + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelOperationMetadata */ - type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelOperationMetadata; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModel}. - * @param error Error, if any - * @param [response] Model + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message UndeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object */ - type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + public static toObject(message: google.cloud.automl.v1.UndeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModels}. - * @param error Error, if any - * @param [response] ListModelsResponse + * Converts this UndeployModelOperationMetadata to JSON. + * @returns JSON object */ - type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelsResponse) => void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateDatasetOperationMetadata. */ + interface ICreateDatasetOperationMetadata { + } + + /** Represents a CreateDatasetOperationMetadata. */ + class CreateDatasetOperationMetadata implements ICreateDatasetOperationMetadata { /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteModel}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new CreateDatasetOperationMetadata. + * @param [properties] Properties to set */ - type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata); /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateModel}. - * @param error Error, if any - * @param [response] Model + * Creates a new CreateDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetOperationMetadata instance */ - type UpdateModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + public static create(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata): google.cloud.automl.v1.CreateDatasetOperationMetadata; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModelEvaluation}. - * @param error Error, if any - * @param [response] ModelEvaluation + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1.ModelEvaluation) => void; + public static encode(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModelEvaluations}. - * @param error Error, if any - * @param [response] ListModelEvaluationsResponse + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelEvaluationsResponse) => void; - } + public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a CreateDatasetRequest. */ - interface ICreateDatasetRequest { + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateDatasetOperationMetadata; - /** CreateDatasetRequest parent */ - parent?: (string|null); + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateDatasetOperationMetadata; - /** CreateDatasetRequest dataset */ - dataset?: (google.cloud.automl.v1.IDataset|null); - } + /** + * Verifies a CreateDatasetOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a CreateDatasetRequest. */ - class CreateDatasetRequest implements ICreateDatasetRequest { + /** + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetOperationMetadata; /** - * Constructs a new CreateDatasetRequest. - * @param [properties] Properties to set + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message CreateDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object */ - constructor(properties?: google.cloud.automl.v1.ICreateDatasetRequest); + public static toObject(message: google.cloud.automl.v1.CreateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CreateDatasetRequest parent. */ - public parent: string; + /** + * Converts this CreateDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateDatasetRequest dataset. */ - public dataset?: (google.cloud.automl.v1.IDataset|null); + /** Properties of a CreateModelOperationMetadata. */ + interface ICreateModelOperationMetadata { + } + + /** Represents a CreateModelOperationMetadata. */ + class CreateModelOperationMetadata implements ICreateModelOperationMetadata { /** - * Creates a new CreateDatasetRequest instance using the specified properties. + * Constructs a new CreateModelOperationMetadata. * @param [properties] Properties to set - * @returns CreateDatasetRequest instance */ - public static create(properties?: google.cloud.automl.v1.ICreateDatasetRequest): google.cloud.automl.v1.CreateDatasetRequest; + constructor(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata); + + /** + * Creates a new CreateModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Verifies a CreateModelOperationMetadata message. + * @param message Plain 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 CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @param message CreateModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportDataOperationMetadata. */ + interface IImportDataOperationMetadata { + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImportDataOperationMetadata); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImportDataOperationMetadata): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Verifies an ImportDataOperationMetadata message. + * @param message Plain 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 ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ImportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportDataOperationMetadata. */ + interface IExportDataOperationMetadata { + + /** ExportDataOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportDataOperationMetadata): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Verifies an ExportDataOperationMetadata message. + * @param message Plain 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 ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ExportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExportDataOperationMetadata { + + /** Properties of an ExportDataOutputInfo. */ + interface IExportDataOutputInfo { + + /** ExportDataOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportDataOutputInfo. */ + class ExportDataOutputInfo implements IExportDataOutputInfo { + + /** + * Constructs a new ExportDataOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo); + + /** ExportDataOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** ExportDataOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Verifies an ExportDataOutputInfo message. + * @param message Plain 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 ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @param message ExportDataOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a BatchPredictOperationMetadata. */ + interface IBatchPredictOperationMetadata { + + /** BatchPredictOperationMetadata inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + } + + /** Represents a BatchPredictOperationMetadata. */ + class BatchPredictOperationMetadata implements IBatchPredictOperationMetadata { + + /** + * Constructs a new BatchPredictOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata); + + /** BatchPredictOperationMetadata inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @param message Plain 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 BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @param message BatchPredictOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BatchPredictOperationMetadata { + + /** Properties of a BatchPredictOutputInfo. */ + interface IBatchPredictOutputInfo { + + /** BatchPredictOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents a BatchPredictOutputInfo. */ + class BatchPredictOutputInfo implements IBatchPredictOutputInfo { + + /** + * Constructs a new BatchPredictOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo); + + /** BatchPredictOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** BatchPredictOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Verifies a BatchPredictOutputInfo message. + * @param message Plain 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 BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @param message BatchPredictOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExportModelOperationMetadata. */ + interface IExportModelOperationMetadata { + + /** ExportModelOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + } + + /** Represents an ExportModelOperationMetadata. */ + class ExportModelOperationMetadata implements IExportModelOperationMetadata { + + /** + * Constructs a new ExportModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportModelOperationMetadata); + + /** ExportModelOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportModelOperationMetadata): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Verifies an ExportModelOperationMetadata message. + * @param message Plain 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 ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @param message ExportModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExportModelOperationMetadata { + + /** Properties of an ExportModelOutputInfo. */ + interface IExportModelOutputInfo { + + /** ExportModelOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportModelOutputInfo. */ + class ExportModelOutputInfo implements IExportModelOutputInfo { + + /** + * Constructs a new ExportModelOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo); + + /** ExportModelOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Verifies an ExportModelOutputInfo message. + * @param message Plain 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 ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @param message ExportModelOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset translationDatasetMetadata */ + translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata */ + imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata */ + textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata */ + imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata */ + textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata */ + textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset exampleCount */ + exampleCount?: (number|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag */ + etag?: (string|null); + + /** Dataset labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDataset); + + /** Dataset translationDatasetMetadata. */ + public translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata. */ + public imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata. */ + public textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata. */ + public imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata. */ + public textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata. */ + public textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset exampleCount. */ + public exampleCount: number; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag. */ + public etag: string; + + /** Dataset labels. */ + public labels: { [k: string]: string }; + + /** Dataset datasetMetadata. */ + public datasetMetadata?: ("translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.automl.v1.IDataset): google.cloud.automl.v1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain 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 Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageClassificationDatasetMetadata. */ + interface IImageClassificationDatasetMetadata { + + /** ImageClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents an ImageClassificationDatasetMetadata. */ + class ImageClassificationDatasetMetadata implements IImageClassificationDatasetMetadata { + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata); + + /** ImageClassificationDatasetMetadata classificationType. */ + public classificationType: google.cloud.automl.v1.ClassificationType; + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @param message Plain 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 ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageObjectDetectionDatasetMetadata. */ + interface IImageObjectDetectionDatasetMetadata { + } + + /** Represents an ImageObjectDetectionDatasetMetadata. */ + class ImageObjectDetectionDatasetMetadata implements IImageObjectDetectionDatasetMetadata { + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata); + + /** + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @param message Plain 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 ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageClassificationModelMetadata. */ + interface IImageClassificationModelMetadata { + + /** ImageClassificationModelMetadata baseModelId */ + baseModelId?: (string|null); + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|null); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|null); + + /** ImageClassificationModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageClassificationModelMetadata modelType */ + modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|null); + } + + /** Represents an ImageClassificationModelMetadata. */ + class ImageClassificationModelMetadata implements IImageClassificationModelMetadata { + + /** + * Constructs a new ImageClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata); + + /** ImageClassificationModelMetadata baseModelId. */ + public baseModelId: string; + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long); + + /** ImageClassificationModelMetadata stopReason. */ + public stopReason: string; + + /** ImageClassificationModelMetadata modelType. */ + public modelType: string; + + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long); + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @param message Plain 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 ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageObjectDetectionModelMetadata. */ + interface IImageObjectDetectionModelMetadata { + + /** ImageObjectDetectionModelMetadata modelType */ + modelType?: (string|null); + + /** ImageObjectDetectionModelMetadata nodeCount */ + nodeCount?: (number|Long|null); + + /** ImageObjectDetectionModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageObjectDetectionModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|null); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|null); + } + + /** Represents an ImageObjectDetectionModelMetadata. */ + class ImageObjectDetectionModelMetadata implements IImageObjectDetectionModelMetadata { + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata); + + /** ImageObjectDetectionModelMetadata modelType. */ + public modelType: string; + + /** ImageObjectDetectionModelMetadata nodeCount. */ + public nodeCount: (number|Long); + + /** ImageObjectDetectionModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageObjectDetectionModelMetadata stopReason. */ + public stopReason: string; + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long); + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @param message Plain 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 ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageClassificationModelDeploymentMetadata. */ + interface IImageClassificationModelDeploymentMetadata { + + /** ImageClassificationModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|null); + } + + /** Represents an ImageClassificationModelDeploymentMetadata. */ + class ImageClassificationModelDeploymentMetadata implements IImageClassificationModelDeploymentMetadata { + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata); + + /** ImageClassificationModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long); + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @param message Plain 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 ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageObjectDetectionModelDeploymentMetadata. */ + interface IImageObjectDetectionModelDeploymentMetadata { + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|null); + } + + /** Represents an ImageObjectDetectionModelDeploymentMetadata. */ + class ImageObjectDetectionModelDeploymentMetadata implements IImageObjectDetectionModelDeploymentMetadata { + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata); + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long); + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @param message Plain 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 ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotationSpec. */ + interface IAnnotationSpec { + + /** AnnotationSpec name */ + name?: (string|null); + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec exampleCount */ + exampleCount?: (number|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IAnnotationSpec); + + /** AnnotationSpec name. */ + public name: string; + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec exampleCount. */ + public exampleCount: number; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.automl.v1.IAnnotationSpec): google.cloud.automl.v1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.AnnotationSpec; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.AnnotationSpec; + + /** + * Verifies an AnnotationSpec message. + * @param message Plain 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 AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationSpec; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @param message AnnotationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.AnnotationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ClassificationType enum. */ + enum ClassificationType { + CLASSIFICATION_TYPE_UNSPECIFIED = 0, + MULTICLASS = 1, + MULTILABEL = 2 + } + + /** Properties of a ClassificationAnnotation. */ + interface IClassificationAnnotation { + + /** ClassificationAnnotation score */ + score?: (number|null); + } + + /** Represents a ClassificationAnnotation. */ + class ClassificationAnnotation implements IClassificationAnnotation { + + /** + * Constructs a new ClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationAnnotation); + + /** ClassificationAnnotation score. */ + public score: number; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationAnnotation): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Verifies a ClassificationAnnotation message. + * @param message Plain 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 ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @param message ClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ClassificationEvaluationMetrics. */ + interface IClassificationEvaluationMetrics { + + /** ClassificationEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** ClassificationEvaluationMetrics auRoc */ + auRoc?: (number|null); + + /** ClassificationEvaluationMetrics logLoss */ + logLoss?: (number|null); + + /** ClassificationEvaluationMetrics confidenceMetricsEntry */ + confidenceMetricsEntry?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]|null); + + /** ClassificationEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a ClassificationEvaluationMetrics. */ + class ClassificationEvaluationMetrics implements IClassificationEvaluationMetrics { + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics); + + /** ClassificationEvaluationMetrics auPrc. */ + public auPrc: number; + + /** ClassificationEvaluationMetrics auRoc. */ + public auRoc: number; + + /** ClassificationEvaluationMetrics logLoss. */ + public logLoss: number; + + /** ClassificationEvaluationMetrics confidenceMetricsEntry. */ + public confidenceMetricsEntry: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** ClassificationEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @param message Plain 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 ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @param message ClassificationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ClassificationEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry positionThreshold */ + positionThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRate */ + falsePositiveRate?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRateAt1 */ + falsePositiveRateAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry truePositiveCount */ + truePositiveCount?: (number|Long|null); + + /** ConfidenceMetricsEntry falsePositiveCount */ + falsePositiveCount?: (number|Long|null); + + /** ConfidenceMetricsEntry falseNegativeCount */ + falseNegativeCount?: (number|Long|null); + + /** ConfidenceMetricsEntry trueNegativeCount */ + trueNegativeCount?: (number|Long|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry positionThreshold. */ + public positionThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry falsePositiveRate. */ + public falsePositiveRate: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry falsePositiveRateAt1. */ + public falsePositiveRateAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry truePositiveCount. */ + public truePositiveCount: (number|Long); + + /** ConfidenceMetricsEntry falsePositiveCount. */ + public falsePositiveCount: (number|Long); + + /** ConfidenceMetricsEntry falseNegativeCount. */ + public falseNegativeCount: (number|Long); + + /** ConfidenceMetricsEntry trueNegativeCount. */ + public trueNegativeCount: (number|Long); + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain 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 ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConfusionMatrix. */ + interface IConfusionMatrix { + + /** ConfusionMatrix annotationSpecId */ + annotationSpecId?: (string[]|null); + + /** ConfusionMatrix displayName */ + displayName?: (string[]|null); + + /** ConfusionMatrix row */ + row?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix); + + /** ConfusionMatrix annotationSpecId. */ + public annotationSpecId: string[]; + + /** ConfusionMatrix displayName. */ + public displayName: string[]; + + /** ConfusionMatrix row. */ + public row: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrix instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Verifies a ConfusionMatrix message. + * @param message Plain 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 ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @param message ConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ConfusionMatrix { + + /** Properties of a Row. */ + interface IRow { + + /** Row exampleCount */ + exampleCount?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow); + + /** Row exampleCount. */ + public exampleCount: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain 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 Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of a TextClassificationDatasetMetadata. */ + interface ITextClassificationDatasetMetadata { + + /** TextClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationDatasetMetadata. */ + class TextClassificationDatasetMetadata implements ITextClassificationDatasetMetadata { + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata); + + /** TextClassificationDatasetMetadata classificationType. */ + public classificationType: google.cloud.automl.v1.ClassificationType; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @param message Plain 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 TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message TextClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextClassificationModelMetadata. */ + interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationModelMetadata. */ + class TextClassificationModelMetadata implements ITextClassificationModelMetadata { + + /** + * Constructs a new TextClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata); + + /** TextClassificationModelMetadata classificationType. */ + public classificationType: google.cloud.automl.v1.ClassificationType; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Verifies a TextClassificationModelMetadata message. + * @param message Plain 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 TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @param message TextClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextExtractionDatasetMetadata. */ + interface ITextExtractionDatasetMetadata { + } + + /** Represents a TextExtractionDatasetMetadata. */ + class TextExtractionDatasetMetadata implements ITextExtractionDatasetMetadata { + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata); + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @param message Plain 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 TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @param message TextExtractionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextExtractionModelMetadata. */ + interface ITextExtractionModelMetadata { + } + + /** Represents a TextExtractionModelMetadata. */ + class TextExtractionModelMetadata implements ITextExtractionModelMetadata { + + /** + * Constructs a new TextExtractionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata); + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Verifies a TextExtractionModelMetadata message. + * @param message Plain 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 TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @param message TextExtractionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextSentimentDatasetMetadata. */ + interface ITextSentimentDatasetMetadata { + + /** TextSentimentDatasetMetadata sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents a TextSentimentDatasetMetadata. */ + class TextSentimentDatasetMetadata implements ITextSentimentDatasetMetadata { + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata); + + /** TextSentimentDatasetMetadata sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @param message Plain 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 TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @param message TextSentimentDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextSentimentModelMetadata. */ + interface ITextSentimentModelMetadata { + } + + /** Represents a TextSentimentModelMetadata. */ + class TextSentimentModelMetadata implements ITextSentimentModelMetadata { + + /** + * Constructs a new TextSentimentModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata); + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Verifies a TextSentimentModelMetadata message. + * @param message Plain 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 TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @param message TextSentimentModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslationDatasetMetadata. */ + interface ITranslationDatasetMetadata { + + /** TranslationDatasetMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationDatasetMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationDatasetMetadata. */ + class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + + /** + * Constructs a new TranslationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata); + + /** TranslationDatasetMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationDatasetMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Verifies a TranslationDatasetMetadata message. + * @param message Plain 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 TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @param message TranslationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslationEvaluationMetrics. */ + interface ITranslationEvaluationMetrics { + + /** TranslationEvaluationMetrics bleuScore */ + bleuScore?: (number|null); + + /** TranslationEvaluationMetrics baseBleuScore */ + baseBleuScore?: (number|null); + } + + /** Represents a TranslationEvaluationMetrics. */ + class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + + /** + * Constructs a new TranslationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics); + + /** TranslationEvaluationMetrics bleuScore. */ + public bleuScore: number; + + /** TranslationEvaluationMetrics baseBleuScore. */ + public baseBleuScore: number; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @param message Plain 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 TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @param message TranslationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslationModelMetadata. */ + interface ITranslationModelMetadata { + + /** TranslationModelMetadata baseModel */ + baseModel?: (string|null); + + /** TranslationModelMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationModelMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationModelMetadata. */ + class TranslationModelMetadata implements ITranslationModelMetadata { + + /** + * Constructs a new TranslationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationModelMetadata); + + /** TranslationModelMetadata baseModel. */ + public baseModel: string; + + /** TranslationModelMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationModelMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationModelMetadata): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Verifies a TranslationModelMetadata message. + * @param message Plain 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 TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @param message TranslationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TranslationAnnotation. */ + interface ITranslationAnnotation { + + /** TranslationAnnotation translatedContent */ + translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + } + + /** Represents a TranslationAnnotation. */ + class TranslationAnnotation implements ITranslationAnnotation { + + /** + * Constructs a new TranslationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationAnnotation); + + /** TranslationAnnotation translatedContent. */ + public translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationAnnotation): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Verifies a TranslationAnnotation message. + * @param message Plain 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 TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @param message TranslationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageBytes */ + imageBytes?: (Uint8Array|null); + + /** Image thumbnailUri */ + thumbnailUri?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImage); + + /** Image imageBytes. */ + public imageBytes: Uint8Array; + + /** Image thumbnailUri. */ + public thumbnailUri: string; + + /** Image data. */ + public data?: "imageBytes"; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.automl.v1.IImage): google.cloud.automl.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextSnippet. */ + interface ITextSnippet { + + /** TextSnippet content */ + content?: (string|null); + + /** TextSnippet mimeType */ + mimeType?: (string|null); + + /** TextSnippet contentUri */ + contentUri?: (string|null); + } + + /** Represents a TextSnippet. */ + class TextSnippet implements ITextSnippet { + + /** + * Constructs a new TextSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSnippet); + + /** TextSnippet content. */ + public content: string; + + /** TextSnippet mimeType. */ + public mimeType: string; + + /** TextSnippet contentUri. */ + public contentUri: string; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSnippet instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSnippet): google.cloud.automl.v1.TextSnippet; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSnippet; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSnippet; + + /** + * Verifies a TextSnippet message. + * @param message Plain 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 TextSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSnippet; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @param message TextSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DocumentDimensions. */ + interface IDocumentDimensions { + + /** DocumentDimensions unit */ + unit?: (google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null); + + /** DocumentDimensions width */ + width?: (number|null); + + /** DocumentDimensions height */ + height?: (number|null); + } + + /** Represents a DocumentDimensions. */ + class DocumentDimensions implements IDocumentDimensions { + + /** + * Constructs a new DocumentDimensions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentDimensions); + + /** DocumentDimensions unit. */ + public unit: google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit; + + /** DocumentDimensions width. */ + public width: number; + + /** DocumentDimensions height. */ + public height: number; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDimensions instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentDimensions): google.cloud.automl.v1.DocumentDimensions; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DocumentDimensions; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DocumentDimensions; + + /** + * Verifies a DocumentDimensions message. + * @param message Plain 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 DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentDimensions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentDimensions; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @param message DocumentDimensions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentDimensions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentDimensions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DocumentDimensions { + + /** DocumentDimensionUnit enum. */ + enum DocumentDimensionUnit { + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0, + INCH = 1, + CENTIMETER = 2, + POINT = 3 + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document inputConfig */ + inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText */ + documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout */ + layout?: (google.cloud.automl.v1.Document.ILayout[]|null); + + /** Document documentDimensions */ + documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount */ + pageCount?: (number|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocument); + + /** Document inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText. */ + public documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout. */ + public layout: google.cloud.automl.v1.Document.ILayout[]; + + /** Document documentDimensions. */ + public documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount. */ + public pageCount: number; + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.automl.v1.IDocument): google.cloud.automl.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Document; + + /** + * Verifies a Document message. + * @param message Plain 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 Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Document { + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber */ + pageNumber?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType */ + textSegmentType?: (google.cloud.automl.v1.Document.Layout.TextSegmentType|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.Document.ILayout); + + /** Layout textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber. */ + public pageNumber: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType. */ + public textSegmentType: google.cloud.automl.v1.Document.Layout.TextSegmentType; + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.automl.v1.Document.ILayout): google.cloud.automl.v1.Document.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Document.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Document.Layout; + + /** + * Verifies a Layout message. + * @param message Plain 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 Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Layout { + + /** TextSegmentType enum. */ + enum TextSegmentType { + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0, + TOKEN = 1, + PARAGRAPH = 2, + FORM_FIELD = 3, + FORM_FIELD_NAME = 4, + FORM_FIELD_CONTENTS = 5, + TABLE = 6, + TABLE_HEADER = 7, + TABLE_ROW = 8, + TABLE_CELL = 9 + } + } + } + + /** Properties of an ExamplePayload. */ + interface IExamplePayload { + + /** ExamplePayload image */ + image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet */ + textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document */ + document?: (google.cloud.automl.v1.IDocument|null); + } + + /** Represents an ExamplePayload. */ + class ExamplePayload implements IExamplePayload { + + /** + * Constructs a new ExamplePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExamplePayload); + + /** ExamplePayload image. */ + public image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet. */ + public textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document. */ + public document?: (google.cloud.automl.v1.IDocument|null); + + /** ExamplePayload payload. */ + public payload?: ("image"|"textSnippet"|"document"); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplePayload instance + */ + public static create(properties?: google.cloud.automl.v1.IExamplePayload): google.cloud.automl.v1.ExamplePayload; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExamplePayload; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExamplePayload; + + /** + * Verifies an ExamplePayload message. + * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExamplePayload; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @param message ExamplePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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.automl.v1.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.automl.v1.INormalizedVertex): google.cloud.automl.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.automl.v1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingPoly); + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.automl.v1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingPoly): google.cloud.automl.v1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BoundingPoly; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BoundingPoly; + + /** + * Verifies a BoundingPoly message. + * @param message Plain 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 BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingPoly; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @param message BoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params. */ + public params: { [k: string]: string }; + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IInputConfig): google.cloud.automl.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain 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 InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchPredictInputConfig. */ + interface IBatchPredictInputConfig { + + /** BatchPredictInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a BatchPredictInputConfig. */ + class BatchPredictInputConfig implements IBatchPredictInputConfig { + + /** + * Constructs a new BatchPredictInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictInputConfig); + + /** BatchPredictInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** BatchPredictInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictInputConfig): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Verifies a BatchPredictInputConfig message. + * @param message Plain 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 BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @param message BatchPredictInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { + + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { + + /** + * Constructs a new DocumentInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentInputConfig); + + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentInputConfig): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Verifies a DocumentInputConfig message. + * @param message Plain 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 DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IOutputConfig): google.cloud.automl.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchPredictOutputConfig. */ + interface IBatchPredictOutputConfig { + + /** BatchPredictOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + } + + /** Represents a BatchPredictOutputConfig. */ + class BatchPredictOutputConfig implements IBatchPredictOutputConfig { + + /** + * Constructs a new BatchPredictOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig); + + /** BatchPredictOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** BatchPredictOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Verifies a BatchPredictOutputConfig message. + * @param message Plain 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 BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @param message BatchPredictOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ModelExportOutputConfig. */ + interface IModelExportOutputConfig { + + /** ModelExportOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat */ + modelFormat?: (string|null); + + /** ModelExportOutputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a ModelExportOutputConfig. */ + class ModelExportOutputConfig implements IModelExportOutputConfig { + + /** + * Constructs a new ModelExportOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelExportOutputConfig); + + /** ModelExportOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat. */ + public modelFormat: string; + + /** ModelExportOutputConfig params. */ + public params: { [k: string]: string }; + + /** ModelExportOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExportOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IModelExportOutputConfig): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Verifies a ModelExportOutputConfig message. + * @param message Plain 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 ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExportOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @param message ModelExportOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelExportOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUris */ + inputUris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsSource): google.cloud.automl.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsDestination): google.cloud.automl.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment content */ + content?: (string|null); + + /** TextSegment startOffset */ + startOffset?: (number|Long|null); + + /** TextSegment endOffset */ + endOffset?: (number|Long|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSegment); + + /** TextSegment content. */ + public content: string; + + /** TextSegment startOffset. */ + public startOffset: (number|Long); + + /** TextSegment endOffset. */ + public endOffset: (number|Long); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSegment): google.cloud.automl.v1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain 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 TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model translationModelMetadata */ + translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata */ + imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata */ + textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata */ + imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata */ + textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata */ + textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name */ + name?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model datasetId */ + datasetId?: (string|null); + + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState */ + deploymentState?: (google.cloud.automl.v1.Model.DeploymentState|null); + + /** Model etag */ + etag?: (string|null); + + /** Model labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModel); + + /** Model translationModelMetadata. */ + public translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata. */ + public imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata. */ + public textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata. */ + public imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata. */ + public textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata. */ + public textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name. */ + public name: string; + + /** Model displayName. */ + public displayName: string; + + /** Model datasetId. */ + public datasetId: string; + + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState. */ + public deploymentState: google.cloud.automl.v1.Model.DeploymentState; + + /** Model etag. */ + public etag: string; + + /** Model labels. */ + public labels: { [k: string]: string }; + + /** Model modelMetadata. */ + public modelMetadata?: ("translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.automl.v1.IModel): google.cloud.automl.v1.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Model; + + /** + * Verifies a Model message. + * @param message Plain 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 Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Model { + + /** DeploymentState enum. */ + enum DeploymentState { + DEPLOYMENT_STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + UNDEPLOYED = 2 + } + } + + /** Properties of a ModelEvaluation. */ + interface IModelEvaluation { + + /** ModelEvaluation classificationEvaluationMetrics */ + classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics */ + translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics */ + imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics */ + textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics */ + textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name */ + name?: (string|null); + + /** ModelEvaluation annotationSpecId */ + annotationSpecId?: (string|null); + + /** ModelEvaluation displayName */ + displayName?: (string|null); + + /** ModelEvaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount */ + evaluatedExampleCount?: (number|null); + } + + /** Represents a ModelEvaluation. */ + class ModelEvaluation implements IModelEvaluation { + + /** + * Constructs a new ModelEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelEvaluation); + + /** ModelEvaluation classificationEvaluationMetrics. */ + public classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics. */ + public translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics. */ + public imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics. */ + public textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics. */ + public textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name. */ + public name: string; + + /** ModelEvaluation annotationSpecId. */ + public annotationSpecId: string; + + /** ModelEvaluation displayName. */ + public displayName: string; + + /** ModelEvaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount. */ + public evaluatedExampleCount: number; + + /** ModelEvaluation metrics. */ + public metrics?: ("classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelEvaluation instance + */ + public static create(properties?: google.cloud.automl.v1.IModelEvaluation): google.cloud.automl.v1.ModelEvaluation; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ModelEvaluation; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ModelEvaluation; + + /** + * Verifies a ModelEvaluation message. + * @param message Plain 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 ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelEvaluation; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @param message ModelEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImageObjectDetectionAnnotation. */ + interface IImageObjectDetectionAnnotation { + + /** ImageObjectDetectionAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score */ + score?: (number|null); + } + + /** Represents an ImageObjectDetectionAnnotation. */ + class ImageObjectDetectionAnnotation implements IImageObjectDetectionAnnotation { + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation); + + /** ImageObjectDetectionAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score. */ + public score: number; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @param message Plain 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 ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @param message ImageObjectDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoundingBoxMetricsEntry. */ + interface IBoundingBoxMetricsEntry { + + /** BoundingBoxMetricsEntry iouThreshold */ + iouThreshold?: (number|null); + + /** BoundingBoxMetricsEntry meanAveragePrecision */ + meanAveragePrecision?: (number|null); + + /** BoundingBoxMetricsEntry confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]|null); + } + + /** Represents a BoundingBoxMetricsEntry. */ + class BoundingBoxMetricsEntry implements IBoundingBoxMetricsEntry { + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry); + + /** BoundingBoxMetricsEntry iouThreshold. */ + public iouThreshold: number; + + /** BoundingBoxMetricsEntry meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** BoundingBoxMetricsEntry confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @param message Plain 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 BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @param message BoundingBoxMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingBoxMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BoundingBoxMetricsEntry { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain 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 ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ImageObjectDetectionEvaluationMetrics. */ + interface IImageObjectDetectionEvaluationMetrics { + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1.IBoundingBoxMetricsEntry[]|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents an ImageObjectDetectionEvaluationMetrics. */ + class ImageObjectDetectionEvaluationMetrics implements IImageObjectDetectionEvaluationMetrics { + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics); + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1.IBoundingBoxMetricsEntry[]; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; /** - * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. - * @param message CreateDatasetRequest message or plain object to encode + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. - * @param message CreateDatasetRequest message or plain object to encode + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateDatasetRequest + * @returns ImageObjectDetectionEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateDatasetRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; /** - * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateDatasetRequest + * @returns ImageObjectDetectionEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateDatasetRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; /** - * Verifies a CreateDatasetRequest message. + * Verifies an ImageObjectDetectionEvaluationMetrics message. * @param message Plain 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 CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateDatasetRequest + * @returns ImageObjectDetectionEvaluationMetrics */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; /** - * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. - * @param message CreateDatasetRequest + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @param message ImageObjectDetectionEvaluationMetrics * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateDatasetRequest to JSON. + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetDatasetRequest. */ - interface IGetDatasetRequest { + /** Properties of a TextExtractionAnnotation. */ + interface ITextExtractionAnnotation { - /** GetDatasetRequest name */ - name?: (string|null); + /** TextExtractionAnnotation textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score */ + score?: (number|null); } - /** Represents a GetDatasetRequest. */ - class GetDatasetRequest implements IGetDatasetRequest { + /** Represents a TextExtractionAnnotation. */ + class TextExtractionAnnotation implements ITextExtractionAnnotation { /** - * Constructs a new GetDatasetRequest. + * Constructs a new TextExtractionAnnotation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IGetDatasetRequest); + constructor(properties?: google.cloud.automl.v1.ITextExtractionAnnotation); - /** GetDatasetRequest name. */ - public name: string; + /** TextExtractionAnnotation textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score. */ + public score: number; + + /** TextExtractionAnnotation annotation. */ + public annotation?: "textSegment"; /** - * Creates a new GetDatasetRequest instance using the specified properties. + * Creates a new TextExtractionAnnotation instance using the specified properties. * @param [properties] Properties to set - * @returns GetDatasetRequest instance + * @returns TextExtractionAnnotation instance */ - public static create(properties?: google.cloud.automl.v1.IGetDatasetRequest): google.cloud.automl.v1.GetDatasetRequest; + public static create(properties?: google.cloud.automl.v1.ITextExtractionAnnotation): google.cloud.automl.v1.TextExtractionAnnotation; /** - * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. - * @param message GetDatasetRequest message or plain object to encode + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. - * @param message GetDatasetRequest message or plain object to encode + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetDatasetRequest message from the specified reader or buffer. + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetDatasetRequest + * @returns TextExtractionAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetDatasetRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionAnnotation; /** - * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetDatasetRequest + * @returns TextExtractionAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetDatasetRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionAnnotation; /** - * Verifies a GetDatasetRequest message. + * Verifies a TextExtractionAnnotation message. * @param message Plain 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 GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetDatasetRequest + * @returns TextExtractionAnnotation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetDatasetRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionAnnotation; /** - * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. - * @param message GetDatasetRequest + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextExtractionAnnotation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.TextExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetDatasetRequest to JSON. + * Converts this TextExtractionAnnotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListDatasetsRequest. */ - interface IListDatasetsRequest { - - /** ListDatasetsRequest parent */ - parent?: (string|null); - - /** ListDatasetsRequest filter */ - filter?: (string|null); + /** Properties of a TextExtractionEvaluationMetrics. */ + interface ITextExtractionEvaluationMetrics { - /** ListDatasetsRequest pageSize */ - pageSize?: (number|null); + /** TextExtractionEvaluationMetrics auPrc */ + auPrc?: (number|null); - /** ListDatasetsRequest pageToken */ - pageToken?: (string|null); + /** TextExtractionEvaluationMetrics confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]|null); } - /** Represents a ListDatasetsRequest. */ - class ListDatasetsRequest implements IListDatasetsRequest { + /** Represents a TextExtractionEvaluationMetrics. */ + class TextExtractionEvaluationMetrics implements ITextExtractionEvaluationMetrics { /** - * Constructs a new ListDatasetsRequest. + * Constructs a new TextExtractionEvaluationMetrics. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IListDatasetsRequest); - - /** ListDatasetsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics); - /** ListDatasetsRequest filter. */ - public filter: string; - - /** ListDatasetsRequest pageSize. */ - public pageSize: number; + /** TextExtractionEvaluationMetrics auPrc. */ + public auPrc: number; - /** ListDatasetsRequest pageToken. */ - public pageToken: string; + /** TextExtractionEvaluationMetrics confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]; /** - * Creates a new ListDatasetsRequest instance using the specified properties. + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. * @param [properties] Properties to set - * @returns ListDatasetsRequest instance + * @returns TextExtractionEvaluationMetrics instance */ - public static create(properties?: google.cloud.automl.v1.IListDatasetsRequest): google.cloud.automl.v1.ListDatasetsRequest; + public static create(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics): google.cloud.automl.v1.TextExtractionEvaluationMetrics; /** - * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. - * @param message ListDatasetsRequest message or plain object to encode + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. - * @param message ListDatasetsRequest message or plain object to encode + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListDatasetsRequest + * @returns TextExtractionEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListDatasetsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionEvaluationMetrics; /** - * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListDatasetsRequest + * @returns TextExtractionEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListDatasetsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionEvaluationMetrics; /** - * Verifies a ListDatasetsRequest message. + * Verifies a TextExtractionEvaluationMetrics message. * @param message Plain 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 ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDatasetsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsRequest; + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextExtractionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TextExtractionEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain 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 ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; - /** - * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. - * @param message ListDatasetsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.automl.v1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ListDatasetsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Properties of a ListDatasetsResponse. */ - interface IListDatasetsResponse { - - /** ListDatasetsResponse datasets */ - datasets?: (google.cloud.automl.v1.IDataset[]|null); + /** Properties of a TextSentimentAnnotation. */ + interface ITextSentimentAnnotation { - /** ListDatasetsResponse nextPageToken */ - nextPageToken?: (string|null); + /** TextSentimentAnnotation sentiment */ + sentiment?: (number|null); } - /** Represents a ListDatasetsResponse. */ - class ListDatasetsResponse implements IListDatasetsResponse { + /** Represents a TextSentimentAnnotation. */ + class TextSentimentAnnotation implements ITextSentimentAnnotation { /** - * Constructs a new ListDatasetsResponse. + * Constructs a new TextSentimentAnnotation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IListDatasetsResponse); + constructor(properties?: google.cloud.automl.v1.ITextSentimentAnnotation); - /** ListDatasetsResponse datasets. */ - public datasets: google.cloud.automl.v1.IDataset[]; - - /** ListDatasetsResponse nextPageToken. */ - public nextPageToken: string; + /** TextSentimentAnnotation sentiment. */ + public sentiment: number; /** - * Creates a new ListDatasetsResponse instance using the specified properties. + * Creates a new TextSentimentAnnotation instance using the specified properties. * @param [properties] Properties to set - * @returns ListDatasetsResponse instance + * @returns TextSentimentAnnotation instance */ - public static create(properties?: google.cloud.automl.v1.IListDatasetsResponse): google.cloud.automl.v1.ListDatasetsResponse; + public static create(properties?: google.cloud.automl.v1.ITextSentimentAnnotation): google.cloud.automl.v1.TextSentimentAnnotation; /** - * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. - * @param message ListDatasetsResponse message or plain object to encode + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. - * @param message ListDatasetsResponse message or plain object to encode + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListDatasetsResponse + * @returns TextSentimentAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListDatasetsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentAnnotation; /** - * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListDatasetsResponse + * @returns TextSentimentAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListDatasetsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentAnnotation; /** - * Verifies a ListDatasetsResponse message. + * Verifies a TextSentimentAnnotation message. * @param message Plain 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 ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListDatasetsResponse + * @returns TextSentimentAnnotation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentAnnotation; /** - * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. - * @param message ListDatasetsResponse + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @param message TextSentimentAnnotation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.TextSentimentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListDatasetsResponse to JSON. + * Converts this TextSentimentAnnotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateDatasetRequest. */ - interface IUpdateDatasetRequest { + /** Properties of a TextSentimentEvaluationMetrics. */ + interface ITextSentimentEvaluationMetrics { - /** UpdateDatasetRequest dataset */ - dataset?: (google.cloud.automl.v1.IDataset|null); + /** TextSentimentEvaluationMetrics precision */ + precision?: (number|null); - /** UpdateDatasetRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** TextSentimentEvaluationMetrics recall */ + recall?: (number|null); + + /** TextSentimentEvaluationMetrics f1Score */ + f1Score?: (number|null); + + /** TextSentimentEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** TextSentimentEvaluationMetrics meanSquaredError */ + meanSquaredError?: (number|null); + + /** TextSentimentEvaluationMetrics linearKappa */ + linearKappa?: (number|null); + + /** TextSentimentEvaluationMetrics quadraticKappa */ + quadraticKappa?: (number|null); + + /** TextSentimentEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); } - /** Represents an UpdateDatasetRequest. */ - class UpdateDatasetRequest implements IUpdateDatasetRequest { + /** Represents a TextSentimentEvaluationMetrics. */ + class TextSentimentEvaluationMetrics implements ITextSentimentEvaluationMetrics { /** - * Constructs a new UpdateDatasetRequest. + * Constructs a new TextSentimentEvaluationMetrics. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IUpdateDatasetRequest); + constructor(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics); - /** UpdateDatasetRequest dataset. */ - public dataset?: (google.cloud.automl.v1.IDataset|null); + /** TextSentimentEvaluationMetrics precision. */ + public precision: number; - /** UpdateDatasetRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** TextSentimentEvaluationMetrics recall. */ + public recall: number; + + /** TextSentimentEvaluationMetrics f1Score. */ + public f1Score: number; + + /** TextSentimentEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** TextSentimentEvaluationMetrics meanSquaredError. */ + public meanSquaredError: number; + + /** TextSentimentEvaluationMetrics linearKappa. */ + public linearKappa: number; + + /** TextSentimentEvaluationMetrics quadraticKappa. */ + public quadraticKappa: number; + + /** TextSentimentEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); /** - * Creates a new UpdateDatasetRequest instance using the specified properties. + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateDatasetRequest instance + * @returns TextSentimentEvaluationMetrics instance */ - public static create(properties?: google.cloud.automl.v1.IUpdateDatasetRequest): google.cloud.automl.v1.UpdateDatasetRequest; + public static create(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics): google.cloud.automl.v1.TextSentimentEvaluationMetrics; /** - * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. - * @param message UpdateDatasetRequest message or plain object to encode + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. - * @param message UpdateDatasetRequest message or plain object to encode + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateDatasetRequest + * @returns TextSentimentEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateDatasetRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSentimentEvaluationMetrics; /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateDatasetRequest + * @returns TextSentimentEvaluationMetrics * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateDatasetRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSentimentEvaluationMetrics; /** - * Verifies an UpdateDatasetRequest message. + * Verifies a TextSentimentEvaluationMetrics message. * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateDatasetRequest + * @returns TextSentimentEvaluationMetrics */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateDatasetRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentEvaluationMetrics; /** - * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. - * @param message UpdateDatasetRequest + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextSentimentEvaluationMetrics * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.TextSentimentEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateDatasetRequest to JSON. + * Converts this TextSentimentEvaluationMetrics to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteDatasetRequest. */ - interface IDeleteDatasetRequest { - - /** DeleteDatasetRequest name */ - name?: (string|null); - } - - /** Represents a DeleteDatasetRequest. */ - class DeleteDatasetRequest implements IDeleteDatasetRequest { - - /** - * Constructs a new DeleteDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.automl.v1.IDeleteDatasetRequest); - - /** DeleteDatasetRequest name. */ - public name: string; + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { /** - * Creates a new DeleteDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDatasetRequest instance + * Constructs a new PredictionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - public static create(properties?: google.cloud.automl.v1.IDeleteDatasetRequest): google.cloud.automl.v1.DeleteDatasetRequest; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. - * @param message DeleteDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Creates new PredictionService 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 encode(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PredictionService; /** - * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. - * @param message DeleteDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse */ - public static encodeDelimited(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public predict(request: google.cloud.automl.v1.IPredictRequest, callback: google.cloud.automl.v1.PredictionService.PredictCallback): void; /** - * Decodes a DeleteDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteDatasetRequest; + public predict(request: google.cloud.automl.v1.IPredictRequest): Promise; /** - * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteDatasetRequest; + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest, callback: google.cloud.automl.v1.PredictionService.BatchPredictCallback): void; /** - * Verifies a DeleteDatasetRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest): Promise; + } - /** - * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteDatasetRequest; + namespace PredictionService { /** - * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. - * @param message DeleteDatasetRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.automl.v1.PredictionService#predict}. + * @param error Error, if any + * @param [response] PredictResponse */ - public static toObject(message: google.cloud.automl.v1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1.PredictResponse) => void; /** - * Converts this DeleteDatasetRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.automl.v1.PredictionService#batchPredict}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type BatchPredictCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of an ImportDataRequest. */ - interface IImportDataRequest { + /** Properties of a PredictRequest. */ + interface IPredictRequest { - /** ImportDataRequest name */ + /** PredictRequest name */ name?: (string|null); - /** ImportDataRequest inputConfig */ - inputConfig?: (google.cloud.automl.v1.IInputConfig|null); + /** PredictRequest payload */ + payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params */ + params?: ({ [k: string]: string }|null); } - /** Represents an ImportDataRequest. */ - class ImportDataRequest implements IImportDataRequest { + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { /** - * Constructs a new ImportDataRequest. + * Constructs a new PredictRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IImportDataRequest); + constructor(properties?: google.cloud.automl.v1.IPredictRequest); - /** ImportDataRequest name. */ + /** PredictRequest name. */ public name: string; - /** ImportDataRequest inputConfig. */ - public inputConfig?: (google.cloud.automl.v1.IInputConfig|null); + /** PredictRequest payload. */ + public payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params. */ + public params: { [k: string]: string }; /** - * Creates a new ImportDataRequest instance using the specified properties. + * Creates a new PredictRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ImportDataRequest instance + * @returns PredictRequest instance */ - public static create(properties?: google.cloud.automl.v1.IImportDataRequest): google.cloud.automl.v1.ImportDataRequest; + public static create(properties?: google.cloud.automl.v1.IPredictRequest): google.cloud.automl.v1.PredictRequest; /** - * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. - * @param message ImportDataRequest message or plain object to encode + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. - * @param message ImportDataRequest message or plain object to encode + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportDataRequest message from the specified reader or buffer. + * Decodes a PredictRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportDataRequest + * @returns PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImportDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictRequest; /** - * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportDataRequest + * @returns PredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImportDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictRequest; /** - * Verifies an ImportDataRequest message. + * Verifies a PredictRequest message. * @param message Plain 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 ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportDataRequest + * @returns PredictRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImportDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictRequest; /** - * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. - * @param message ImportDataRequest + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportDataRequest to JSON. + * Converts this PredictRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExportDataRequest. */ - interface IExportDataRequest { + /** Properties of a PredictResponse. */ + interface IPredictResponse { - /** ExportDataRequest name */ - name?: (string|null); + /** PredictResponse payload */ + payload?: (google.cloud.automl.v1.IAnnotationPayload[]|null); - /** ExportDataRequest outputConfig */ - outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + /** PredictResponse preprocessedInput */ + preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata */ + metadata?: ({ [k: string]: string }|null); } - /** Represents an ExportDataRequest. */ - class ExportDataRequest implements IExportDataRequest { + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { /** - * Constructs a new ExportDataRequest. + * Constructs a new PredictResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IExportDataRequest); + constructor(properties?: google.cloud.automl.v1.IPredictResponse); - /** ExportDataRequest name. */ - public name: string; + /** PredictResponse payload. */ + public payload: google.cloud.automl.v1.IAnnotationPayload[]; - /** ExportDataRequest outputConfig. */ - public outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + /** PredictResponse preprocessedInput. */ + public preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata. */ + public metadata: { [k: string]: string }; /** - * Creates a new ExportDataRequest instance using the specified properties. + * Creates a new PredictResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportDataRequest instance + * @returns PredictResponse instance */ - public static create(properties?: google.cloud.automl.v1.IExportDataRequest): google.cloud.automl.v1.ExportDataRequest; + public static create(properties?: google.cloud.automl.v1.IPredictResponse): google.cloud.automl.v1.PredictResponse; /** - * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. - * @param message ExportDataRequest message or plain object to encode + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. - * @param message ExportDataRequest message or plain object to encode + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportDataRequest message from the specified reader or buffer. + * Decodes a PredictResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportDataRequest + * @returns PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictResponse; /** - * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportDataRequest + * @returns PredictResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictResponse; /** - * Verifies an ExportDataRequest message. + * Verifies a PredictResponse message. * @param message Plain 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 ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportDataRequest + * @returns PredictResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictResponse; /** - * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. - * @param message ExportDataRequest + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportDataRequest to JSON. + * Converts this PredictResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateModelRequest. */ - interface ICreateModelRequest { + /** Properties of a BatchPredictRequest. */ + interface IBatchPredictRequest { - /** CreateModelRequest parent */ - parent?: (string|null); + /** BatchPredictRequest name */ + name?: (string|null); - /** CreateModelRequest model */ - model?: (google.cloud.automl.v1.IModel|null); + /** BatchPredictRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params */ + params?: ({ [k: string]: string }|null); } - /** Represents a CreateModelRequest. */ - class CreateModelRequest implements ICreateModelRequest { + /** Represents a BatchPredictRequest. */ + class BatchPredictRequest implements IBatchPredictRequest { /** - * Constructs a new CreateModelRequest. + * Constructs a new BatchPredictRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ICreateModelRequest); + constructor(properties?: google.cloud.automl.v1.IBatchPredictRequest); - /** CreateModelRequest parent. */ - public parent: string; + /** BatchPredictRequest name. */ + public name: string; - /** CreateModelRequest model. */ - public model?: (google.cloud.automl.v1.IModel|null); + /** BatchPredictRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params. */ + public params: { [k: string]: string }; /** - * Creates a new CreateModelRequest instance using the specified properties. + * Creates a new BatchPredictRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateModelRequest instance + * @returns BatchPredictRequest instance */ - public static create(properties?: google.cloud.automl.v1.ICreateModelRequest): google.cloud.automl.v1.CreateModelRequest; + public static create(properties?: google.cloud.automl.v1.IBatchPredictRequest): google.cloud.automl.v1.BatchPredictRequest; /** - * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. - * @param message CreateModelRequest message or plain object to encode + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. - * @param message CreateModelRequest message or plain object to encode + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateModelRequest message from the specified reader or buffer. + * Decodes a BatchPredictRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateModelRequest + * @returns BatchPredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictRequest; /** - * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateModelRequest + * @returns BatchPredictRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictRequest; /** - * Verifies a CreateModelRequest message. + * Verifies a BatchPredictRequest message. * @param message Plain 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 CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateModelRequest + * @returns BatchPredictRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictRequest; /** - * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. - * @param message CreateModelRequest + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @param message BatchPredictRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.BatchPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateModelRequest to JSON. + * Converts this BatchPredictRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetModelRequest. */ - interface IGetModelRequest { + /** Properties of a BatchPredictResult. */ + interface IBatchPredictResult { - /** GetModelRequest name */ - name?: (string|null); + /** BatchPredictResult metadata */ + metadata?: ({ [k: string]: string }|null); } - /** Represents a GetModelRequest. */ - class GetModelRequest implements IGetModelRequest { + /** Represents a BatchPredictResult. */ + class BatchPredictResult implements IBatchPredictResult { /** - * Constructs a new GetModelRequest. + * Constructs a new BatchPredictResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IGetModelRequest); + constructor(properties?: google.cloud.automl.v1.IBatchPredictResult); - /** GetModelRequest name. */ - public name: string; + /** BatchPredictResult metadata. */ + public metadata: { [k: string]: string }; /** - * Creates a new GetModelRequest instance using the specified properties. + * Creates a new BatchPredictResult instance using the specified properties. * @param [properties] Properties to set - * @returns GetModelRequest instance + * @returns BatchPredictResult instance */ - public static create(properties?: google.cloud.automl.v1.IGetModelRequest): google.cloud.automl.v1.GetModelRequest; + public static create(properties?: google.cloud.automl.v1.IBatchPredictResult): google.cloud.automl.v1.BatchPredictResult; /** - * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. - * @param message GetModelRequest message or plain object to encode + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. - * @param message GetModelRequest message or plain object to encode + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetModelRequest message from the specified reader or buffer. + * Decodes a BatchPredictResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetModelRequest + * @returns BatchPredictResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.BatchPredictResult; /** - * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetModelRequest + * @returns BatchPredictResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.BatchPredictResult; /** - * Verifies a GetModelRequest message. + * Verifies a BatchPredictResult message. * @param message Plain 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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetModelRequest + * @returns BatchPredictResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictResult; /** - * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. - * @param message GetModelRequest + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetModelRequest to JSON. + * Converts this BatchPredictResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListModelsRequest. */ - interface IListModelsRequest { + /** Properties of an AnnotationPayload. */ + interface IAnnotationPayload { - /** ListModelsRequest parent */ - parent?: (string|null); + /** AnnotationPayload translation */ + translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); - /** ListModelsRequest filter */ - filter?: (string|null); + /** AnnotationPayload classification */ + classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); - /** ListModelsRequest pageSize */ - pageSize?: (number|null); + /** AnnotationPayload imageObjectDetection */ + imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); - /** ListModelsRequest pageToken */ - pageToken?: (string|null); + /** AnnotationPayload textExtraction */ + textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment */ + textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId */ + annotationSpecId?: (string|null); + + /** AnnotationPayload displayName */ + displayName?: (string|null); } - /** Represents a ListModelsRequest. */ - class ListModelsRequest implements IListModelsRequest { + /** Represents an AnnotationPayload. */ + class AnnotationPayload implements IAnnotationPayload { /** - * Constructs a new ListModelsRequest. + * Constructs a new AnnotationPayload. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IListModelsRequest); + constructor(properties?: google.cloud.automl.v1.IAnnotationPayload); - /** ListModelsRequest parent. */ - public parent: string; + /** AnnotationPayload translation. */ + public translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); - /** ListModelsRequest filter. */ - public filter: string; + /** AnnotationPayload classification. */ + public classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); - /** ListModelsRequest pageSize. */ - public pageSize: number; + /** AnnotationPayload imageObjectDetection. */ + public imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); - /** ListModelsRequest pageToken. */ - public pageToken: string; + /** AnnotationPayload textExtraction. */ + public textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment. */ + public textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId. */ + public annotationSpecId: string; + + /** AnnotationPayload displayName. */ + public displayName: string; + + /** AnnotationPayload detail. */ + public detail?: ("translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"); /** - * Creates a new ListModelsRequest instance using the specified properties. + * Creates a new AnnotationPayload instance using the specified properties. * @param [properties] Properties to set - * @returns ListModelsRequest instance + * @returns AnnotationPayload instance */ - public static create(properties?: google.cloud.automl.v1.IListModelsRequest): google.cloud.automl.v1.ListModelsRequest; + public static create(properties?: google.cloud.automl.v1.IAnnotationPayload): google.cloud.automl.v1.AnnotationPayload; /** - * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. - * @param message ListModelsRequest message or plain object to encode + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. - * @param message ListModelsRequest message or plain object to encode + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListModelsRequest message from the specified reader or buffer. + * Decodes an AnnotationPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListModelsRequest + * @returns AnnotationPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.AnnotationPayload; /** - * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListModelsRequest + * @returns AnnotationPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.AnnotationPayload; /** - * Verifies a ListModelsRequest message. + * Verifies an AnnotationPayload message. * @param message Plain 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 ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListModelsRequest + * @returns AnnotationPayload */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationPayload; /** - * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. - * @param message ListModelsRequest + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @param message AnnotationPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListModelsRequest to JSON. + * Converts this AnnotationPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListModelsResponse. */ - interface IListModelsResponse { + /** Represents an AutoMl */ + class AutoMl extends $protobuf.rpc.Service { - /** ListModelsResponse model */ - model?: (google.cloud.automl.v1.IModel[]|null); + /** + * Constructs a new AutoMl 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); - /** ListModelsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * Creates new AutoMl 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): AutoMl; - /** Represents a ListModelsResponse. */ - class ListModelsResponse implements IListModelsResponse { + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest): Promise; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.cloud.automl.v1.IGetDatasetRequest, callback: google.cloud.automl.v1.AutoMl.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.automl.v1.IGetDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + */ + public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest, callback: google.cloud.automl.v1.AutoMl.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest, callback: google.cloud.automl.v1.AutoMl.DeleteDatasetCallback): void; /** - * Constructs a new ListModelsResponse. - * @param [properties] Properties to set + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.automl.v1.IListModelsResponse); - - /** ListModelsResponse model. */ - public model: google.cloud.automl.v1.IModel[]; - - /** ListModelsResponse nextPageToken. */ - public nextPageToken: string; + public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest): Promise; /** - * Creates a new ListModelsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListModelsResponse instance + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static create(properties?: google.cloud.automl.v1.IListModelsResponse): google.cloud.automl.v1.ListModelsResponse; + public importData(request: google.cloud.automl.v1.IImportDataRequest, callback: google.cloud.automl.v1.AutoMl.ImportDataCallback): void; /** - * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. - * @param message ListModelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public importData(request: google.cloud.automl.v1.IImportDataRequest): Promise; /** - * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. - * @param message ListModelsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encodeDelimited(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public exportData(request: google.cloud.automl.v1.IExportDataRequest, callback: google.cloud.automl.v1.AutoMl.ExportDataCallback): void; /** - * Decodes a ListModelsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListModelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsResponse; + public exportData(request: google.cloud.automl.v1.IExportDataRequest): Promise; /** - * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListModelsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpec */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsResponse; + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest, callback: google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback): void; /** - * Verifies a ListModelsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest): Promise; /** - * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListModelsResponse + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsResponse; + public createModel(request: google.cloud.automl.v1.ICreateModelRequest, callback: google.cloud.automl.v1.AutoMl.CreateModelCallback): void; /** - * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. - * @param message ListModelsResponse - * @param [options] Conversion options - * @returns Plain object + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.automl.v1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public createModel(request: google.cloud.automl.v1.ICreateModelRequest): Promise; /** - * Converts this ListModelsResponse to JSON. - * @returns JSON object + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DeleteModelRequest. */ - interface IDeleteModelRequest { - - /** DeleteModelRequest name */ - name?: (string|null); - } - - /** Represents a DeleteModelRequest. */ - class DeleteModelRequest implements IDeleteModelRequest { + public getModel(request: google.cloud.automl.v1.IGetModelRequest, callback: google.cloud.automl.v1.AutoMl.GetModelCallback): void; /** - * Constructs a new DeleteModelRequest. - * @param [properties] Properties to set + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.automl.v1.IDeleteModelRequest); - - /** DeleteModelRequest name. */ - public name: string; + public getModel(request: google.cloud.automl.v1.IGetModelRequest): Promise; /** - * Creates a new DeleteModelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteModelRequest instance + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse */ - public static create(properties?: google.cloud.automl.v1.IDeleteModelRequest): google.cloud.automl.v1.DeleteModelRequest; + public listModels(request: google.cloud.automl.v1.IListModelsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelsCallback): void; /** - * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. - * @param message DeleteModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listModels(request: google.cloud.automl.v1.IListModelsRequest): Promise; /** - * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. - * @param message DeleteModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encodeDelimited(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest, callback: google.cloud.automl.v1.AutoMl.DeleteModelCallback): void; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteModelRequest; + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest): Promise; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteModelRequest; + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest, callback: google.cloud.automl.v1.AutoMl.UpdateModelCallback): void; /** - * Verifies a DeleteModelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest): Promise; /** - * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteModelRequest + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteModelRequest; + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest, callback: google.cloud.automl.v1.AutoMl.DeployModelCallback): void; /** - * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. - * @param message DeleteModelRequest - * @param [options] Conversion options - * @returns Plain object + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.automl.v1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest): Promise; /** - * Converts this DeleteModelRequest to JSON. - * @returns JSON object + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an UpdateModelRequest. */ - interface IUpdateModelRequest { + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest, callback: google.cloud.automl.v1.AutoMl.UndeployModelCallback): void; - /** UpdateModelRequest model */ - model?: (google.cloud.automl.v1.IModel|null); + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @returns Promise + */ + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest): Promise; - /** UpdateModelRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest, callback: google.cloud.automl.v1.AutoMl.ExportModelCallback): void; - /** Represents an UpdateModelRequest. */ - class UpdateModelRequest implements IUpdateModelRequest { + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @returns Promise + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest): Promise; /** - * Constructs a new UpdateModelRequest. - * @param [properties] Properties to set + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModelEvaluation */ - constructor(properties?: google.cloud.automl.v1.IUpdateModelRequest); + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback): void; - /** UpdateModelRequest model. */ - public model?: (google.cloud.automl.v1.IModel|null); + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @returns Promise + */ + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest): Promise; - /** UpdateModelRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + */ + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback): void; /** - * Creates a new UpdateModelRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateModelRequest instance + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.automl.v1.IUpdateModelRequest): google.cloud.automl.v1.UpdateModelRequest; + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest): Promise; + } + + namespace AutoMl { /** - * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. - * @param message UpdateModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.automl.v1.AutoMl#createDataset}. + * @param error Error, if any + * @param [response] Operation */ - public static encode(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type CreateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. - * @param message UpdateModelRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getDataset}. + * @param error Error, if any + * @param [response] Dataset */ - public static encodeDelimited(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; /** - * Decodes an UpdateModelRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateModelRequest; + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListDatasetsResponse) => void; /** - * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateDataset}. + * @param error Error, if any + * @param [response] Dataset */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateModelRequest; + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; /** - * Verifies an UpdateModelRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteDataset}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateModelRequest + * Callback as used by {@link google.cloud.automl.v1.AutoMl#importData}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateModelRequest; + type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. - * @param message UpdateModelRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportData}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.automl.v1.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this UpdateModelRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getAnnotationSpec}. + * @param error Error, if any + * @param [response] AnnotationSpec */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a GetModelEvaluationRequest. */ - interface IGetModelEvaluationRequest { - - /** GetModelEvaluationRequest name */ - name?: (string|null); - } - - /** Represents a GetModelEvaluationRequest. */ - class GetModelEvaluationRequest implements IGetModelEvaluationRequest { + type GetAnnotationSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1.AnnotationSpec) => void; /** - * Constructs a new GetModelEvaluationRequest. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.automl.v1.AutoMl#createModel}. + * @param error Error, if any + * @param [response] Operation */ - constructor(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest); - - /** GetModelEvaluationRequest name. */ - public name: string; + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a new GetModelEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetModelEvaluationRequest instance + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModel}. + * @param error Error, if any + * @param [response] Model */ - public static create(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest): google.cloud.automl.v1.GetModelEvaluationRequest; + type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; /** - * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. - * @param message GetModelEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse */ - public static encode(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelsResponse) => void; /** - * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. - * @param message GetModelEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteModel}. + * @param error Error, if any + * @param [response] Operation */ - public static encodeDelimited(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetModelEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateModel}. + * @param error Error, if any + * @param [response] Model */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelEvaluationRequest; + type UpdateModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; /** - * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetModelEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deployModel}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelEvaluationRequest; + type DeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies a GetModelEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.automl.v1.AutoMl#undeployModel}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetModelEvaluationRequest + * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportModel}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelEvaluationRequest; + type ExportModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. - * @param message GetModelEvaluationRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModelEvaluation}. + * @param error Error, if any + * @param [response] ModelEvaluation */ - public static toObject(message: google.cloud.automl.v1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1.ModelEvaluation) => void; /** - * Converts this GetModelEvaluationRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModelEvaluations}. + * @param error Error, if any + * @param [response] ListModelEvaluationsResponse */ - public toJSON(): { [k: string]: any }; + type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelEvaluationsResponse) => void; } - /** Properties of a ListModelEvaluationsRequest. */ - interface IListModelEvaluationsRequest { + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { - /** ListModelEvaluationsRequest parent */ + /** CreateDatasetRequest parent */ parent?: (string|null); - /** ListModelEvaluationsRequest filter */ - filter?: (string|null); - - /** ListModelEvaluationsRequest pageSize */ - pageSize?: (number|null); - - /** ListModelEvaluationsRequest pageToken */ - pageToken?: (string|null); + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); } - /** Represents a ListModelEvaluationsRequest. */ - class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { /** - * Constructs a new ListModelEvaluationsRequest. + * Constructs a new CreateDatasetRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest); + constructor(properties?: google.cloud.automl.v1.ICreateDatasetRequest); - /** ListModelEvaluationsRequest parent. */ + /** CreateDatasetRequest parent. */ public parent: string; - /** ListModelEvaluationsRequest filter. */ - public filter: string; - - /** ListModelEvaluationsRequest pageSize. */ - public pageSize: number; - - /** ListModelEvaluationsRequest pageToken. */ - public pageToken: string; + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.IDataset|null); /** - * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * Creates a new CreateDatasetRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListModelEvaluationsRequest instance + * @returns CreateDatasetRequest instance */ - public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest): google.cloud.automl.v1.ListModelEvaluationsRequest; + public static create(properties?: google.cloud.automl.v1.ICreateDatasetRequest): google.cloud.automl.v1.CreateDatasetRequest; /** - * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. - * @param message ListModelEvaluationsRequest message or plain object to encode + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. - * @param message ListModelEvaluationsRequest message or plain object to encode + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * Decodes a CreateDatasetRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListModelEvaluationsRequest + * @returns CreateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateDatasetRequest; /** - * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListModelEvaluationsRequest + * @returns CreateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateDatasetRequest; /** - * Verifies a ListModelEvaluationsRequest message. + * Verifies a CreateDatasetRequest message. * @param message Plain 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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListModelEvaluationsRequest + * @returns CreateDatasetRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetRequest; /** - * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. - * @param message ListModelEvaluationsRequest + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @param message CreateDatasetRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListModelEvaluationsRequest to JSON. + * Converts this CreateDatasetRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListModelEvaluationsResponse. */ - interface IListModelEvaluationsResponse { - - /** ListModelEvaluationsResponse modelEvaluation */ - modelEvaluation?: (google.cloud.automl.v1.IModelEvaluation[]|null); + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { - /** ListModelEvaluationsResponse nextPageToken */ - nextPageToken?: (string|null); + /** GetDatasetRequest name */ + name?: (string|null); } - /** Represents a ListModelEvaluationsResponse. */ - class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { /** - * Constructs a new ListModelEvaluationsResponse. + * Constructs a new GetDatasetRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse); - - /** ListModelEvaluationsResponse modelEvaluation. */ - public modelEvaluation: google.cloud.automl.v1.IModelEvaluation[]; + constructor(properties?: google.cloud.automl.v1.IGetDatasetRequest); - /** ListModelEvaluationsResponse nextPageToken. */ - public nextPageToken: string; + /** GetDatasetRequest name. */ + public name: string; /** - * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * Creates a new GetDatasetRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListModelEvaluationsResponse instance + * @returns GetDatasetRequest instance */ - public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse): google.cloud.automl.v1.ListModelEvaluationsResponse; + public static create(properties?: google.cloud.automl.v1.IGetDatasetRequest): google.cloud.automl.v1.GetDatasetRequest; /** - * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. - * @param message ListModelEvaluationsResponse message or plain object to encode + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. - * @param message ListModelEvaluationsResponse message or plain object to encode + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * Decodes a GetDatasetRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListModelEvaluationsResponse + * @returns GetDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetDatasetRequest; /** - * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListModelEvaluationsResponse + * @returns GetDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetDatasetRequest; /** - * Verifies a ListModelEvaluationsResponse message. + * Verifies a GetDatasetRequest message. * @param message Plain 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 ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListModelEvaluationsResponse + * @returns GetDatasetRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetDatasetRequest; /** - * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. - * @param message ListModelEvaluationsResponse + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListModelEvaluationsResponse to JSON. + * Converts this GetDatasetRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AnnotationPayload. */ - interface IAnnotationPayload { + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { - /** AnnotationPayload translation */ - translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + /** ListDatasetsRequest parent */ + parent?: (string|null); + + /** ListDatasetsRequest filter */ + filter?: (string|null); + + /** ListDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); } - /** Represents an AnnotationPayload. */ - class AnnotationPayload implements IAnnotationPayload { + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { /** - * Constructs a new AnnotationPayload. + * Constructs a new ListDatasetsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IAnnotationPayload); + constructor(properties?: google.cloud.automl.v1.IListDatasetsRequest); - /** AnnotationPayload translation. */ - public translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + /** ListDatasetsRequest parent. */ + public parent: string; - /** AnnotationPayload detail. */ - public detail?: "translation"; + /** ListDatasetsRequest filter. */ + public filter: string; + + /** ListDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; /** - * Creates a new AnnotationPayload instance using the specified properties. + * Creates a new ListDatasetsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AnnotationPayload instance + * @returns ListDatasetsRequest instance */ - public static create(properties?: google.cloud.automl.v1.IAnnotationPayload): google.cloud.automl.v1.AnnotationPayload; + public static create(properties?: google.cloud.automl.v1.IListDatasetsRequest): google.cloud.automl.v1.ListDatasetsRequest; /** - * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. - * @param message AnnotationPayload message or plain object to encode + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. - * @param message AnnotationPayload message or plain object to encode + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AnnotationPayload message from the specified reader or buffer. + * Decodes a ListDatasetsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AnnotationPayload + * @returns ListDatasetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.AnnotationPayload; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListDatasetsRequest; /** - * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AnnotationPayload + * @returns ListDatasetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.AnnotationPayload; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListDatasetsRequest; /** - * Verifies an AnnotationPayload message. + * Verifies a ListDatasetsRequest message. * @param message Plain 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 AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AnnotationPayload + * @returns ListDatasetsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationPayload; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsRequest; /** - * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. - * @param message AnnotationPayload + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AnnotationPayload to JSON. + * Converts this ListDatasetsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TranslationDatasetMetadata. */ - interface ITranslationDatasetMetadata { + /** Properties of a ListDatasetsResponse. */ + interface IListDatasetsResponse { - /** TranslationDatasetMetadata sourceLanguageCode */ - sourceLanguageCode?: (string|null); + /** ListDatasetsResponse datasets */ + datasets?: (google.cloud.automl.v1.IDataset[]|null); - /** TranslationDatasetMetadata targetLanguageCode */ - targetLanguageCode?: (string|null); + /** ListDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a TranslationDatasetMetadata. */ - class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + /** Represents a ListDatasetsResponse. */ + class ListDatasetsResponse implements IListDatasetsResponse { /** - * Constructs a new TranslationDatasetMetadata. + * Constructs a new ListDatasetsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata); + constructor(properties?: google.cloud.automl.v1.IListDatasetsResponse); - /** TranslationDatasetMetadata sourceLanguageCode. */ - public sourceLanguageCode: string; + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.automl.v1.IDataset[]; - /** TranslationDatasetMetadata targetLanguageCode. */ - public targetLanguageCode: string; + /** ListDatasetsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new TranslationDatasetMetadata instance using the specified properties. + * Creates a new ListDatasetsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TranslationDatasetMetadata instance + * @returns ListDatasetsResponse instance */ - public static create(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata): google.cloud.automl.v1.TranslationDatasetMetadata; + public static create(properties?: google.cloud.automl.v1.IListDatasetsResponse): google.cloud.automl.v1.ListDatasetsResponse; /** - * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. - * @param message TranslationDatasetMetadata message or plain object to encode + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. - * @param message TranslationDatasetMetadata message or plain object to encode + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * Decodes a ListDatasetsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TranslationDatasetMetadata + * @returns ListDatasetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationDatasetMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListDatasetsResponse; /** - * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TranslationDatasetMetadata + * @returns ListDatasetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationDatasetMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListDatasetsResponse; /** - * Verifies a TranslationDatasetMetadata message. + * Verifies a ListDatasetsResponse message. * @param message Plain 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 TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TranslationDatasetMetadata + * @returns ListDatasetsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationDatasetMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsResponse; /** - * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. - * @param message TranslationDatasetMetadata + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @param message ListDatasetsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TranslationDatasetMetadata to JSON. + * Converts this ListDatasetsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TranslationEvaluationMetrics. */ - interface ITranslationEvaluationMetrics { + /** Properties of an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { - /** TranslationEvaluationMetrics bleuScore */ - bleuScore?: (number|null); + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); - /** TranslationEvaluationMetrics baseBleuScore */ - baseBleuScore?: (number|null); + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TranslationEvaluationMetrics. */ - class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { /** - * Constructs a new TranslationEvaluationMetrics. + * Constructs a new UpdateDatasetRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics); + constructor(properties?: google.cloud.automl.v1.IUpdateDatasetRequest); - /** TranslationEvaluationMetrics bleuScore. */ - public bleuScore: number; + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.IDataset|null); - /** TranslationEvaluationMetrics baseBleuScore. */ - public baseBleuScore: number; + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * Creates a new UpdateDatasetRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TranslationEvaluationMetrics instance + * @returns UpdateDatasetRequest instance */ - public static create(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics): google.cloud.automl.v1.TranslationEvaluationMetrics; + public static create(properties?: google.cloud.automl.v1.IUpdateDatasetRequest): google.cloud.automl.v1.UpdateDatasetRequest; /** - * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. - * @param message TranslationEvaluationMetrics message or plain object to encode + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. - * @param message TranslationEvaluationMetrics message or plain object to encode + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TranslationEvaluationMetrics + * @returns UpdateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationEvaluationMetrics; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateDatasetRequest; /** - * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TranslationEvaluationMetrics + * @returns UpdateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationEvaluationMetrics; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateDatasetRequest; /** - * Verifies a TranslationEvaluationMetrics message. + * Verifies an UpdateDatasetRequest message. * @param message Plain 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 TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TranslationEvaluationMetrics + * @returns UpdateDatasetRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationEvaluationMetrics; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateDatasetRequest; /** - * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. - * @param message TranslationEvaluationMetrics + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TranslationEvaluationMetrics to JSON. + * Converts this UpdateDatasetRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TranslationModelMetadata. */ - interface ITranslationModelMetadata { - - /** TranslationModelMetadata baseModel */ - baseModel?: (string|null); - - /** TranslationModelMetadata sourceLanguageCode */ - sourceLanguageCode?: (string|null); + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { - /** TranslationModelMetadata targetLanguageCode */ - targetLanguageCode?: (string|null); + /** DeleteDatasetRequest name */ + name?: (string|null); } - /** Represents a TranslationModelMetadata. */ - class TranslationModelMetadata implements ITranslationModelMetadata { + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { /** - * Constructs a new TranslationModelMetadata. + * Constructs a new DeleteDatasetRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ITranslationModelMetadata); - - /** TranslationModelMetadata baseModel. */ - public baseModel: string; - - /** TranslationModelMetadata sourceLanguageCode. */ - public sourceLanguageCode: string; + constructor(properties?: google.cloud.automl.v1.IDeleteDatasetRequest); - /** TranslationModelMetadata targetLanguageCode. */ - public targetLanguageCode: string; + /** DeleteDatasetRequest name. */ + public name: string; /** - * Creates a new TranslationModelMetadata instance using the specified properties. + * Creates a new DeleteDatasetRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TranslationModelMetadata instance + * @returns DeleteDatasetRequest instance */ - public static create(properties?: google.cloud.automl.v1.ITranslationModelMetadata): google.cloud.automl.v1.TranslationModelMetadata; + public static create(properties?: google.cloud.automl.v1.IDeleteDatasetRequest): google.cloud.automl.v1.DeleteDatasetRequest; /** - * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. - * @param message TranslationModelMetadata message or plain object to encode + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. - * @param message TranslationModelMetadata message or plain object to encode + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TranslationModelMetadata + * @returns DeleteDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationModelMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteDatasetRequest; /** - * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TranslationModelMetadata + * @returns DeleteDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationModelMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteDatasetRequest; /** - * Verifies a TranslationModelMetadata message. + * Verifies a DeleteDatasetRequest message. * @param message Plain 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 TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TranslationModelMetadata + * @returns DeleteDatasetRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationModelMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteDatasetRequest; /** - * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. - * @param message TranslationModelMetadata + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TranslationModelMetadata to JSON. + * Converts this DeleteDatasetRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TranslationAnnotation. */ - interface ITranslationAnnotation { + /** Properties of an ImportDataRequest. */ + interface IImportDataRequest { - /** TranslationAnnotation translatedContent */ - translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + /** ImportDataRequest name */ + name?: (string|null); + + /** ImportDataRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1.IInputConfig|null); } - /** Represents a TranslationAnnotation. */ - class TranslationAnnotation implements ITranslationAnnotation { + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { /** - * Constructs a new TranslationAnnotation. + * Constructs a new ImportDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ITranslationAnnotation); + constructor(properties?: google.cloud.automl.v1.IImportDataRequest); - /** TranslationAnnotation translatedContent. */ - public translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IInputConfig|null); /** - * Creates a new TranslationAnnotation instance using the specified properties. + * Creates a new ImportDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TranslationAnnotation instance + * @returns ImportDataRequest instance */ - public static create(properties?: google.cloud.automl.v1.ITranslationAnnotation): google.cloud.automl.v1.TranslationAnnotation; + public static create(properties?: google.cloud.automl.v1.IImportDataRequest): google.cloud.automl.v1.ImportDataRequest; /** - * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. - * @param message TranslationAnnotation message or plain object to encode + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. - * @param message TranslationAnnotation message or plain object to encode + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TranslationAnnotation message from the specified reader or buffer. + * Decodes an ImportDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TranslationAnnotation + * @returns ImportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TranslationAnnotation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ImportDataRequest; /** - * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TranslationAnnotation + * @returns ImportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TranslationAnnotation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ImportDataRequest; /** - * Verifies a TranslationAnnotation message. + * Verifies an ImportDataRequest message. * @param message Plain 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 TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TranslationAnnotation + * @returns ImportDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationAnnotation; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImportDataRequest; /** - * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. - * @param message TranslationAnnotation + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @param message ImportDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TranslationAnnotation to JSON. + * Converts this ImportDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TextSnippet. */ - interface ITextSnippet { - - /** TextSnippet content */ - content?: (string|null); + /** Properties of an ExportDataRequest. */ + interface IExportDataRequest { - /** TextSnippet mimeType */ - mimeType?: (string|null); + /** ExportDataRequest name */ + name?: (string|null); - /** TextSnippet contentUri */ - contentUri?: (string|null); + /** ExportDataRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); } - /** Represents a TextSnippet. */ - class TextSnippet implements ITextSnippet { + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { /** - * Constructs a new TextSnippet. + * Constructs a new ExportDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ITextSnippet); - - /** TextSnippet content. */ - public content: string; + constructor(properties?: google.cloud.automl.v1.IExportDataRequest); - /** TextSnippet mimeType. */ - public mimeType: string; + /** ExportDataRequest name. */ + public name: string; - /** TextSnippet contentUri. */ - public contentUri: string; + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); /** - * Creates a new TextSnippet instance using the specified properties. + * Creates a new ExportDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TextSnippet instance + * @returns ExportDataRequest instance */ - public static create(properties?: google.cloud.automl.v1.ITextSnippet): google.cloud.automl.v1.TextSnippet; + public static create(properties?: google.cloud.automl.v1.IExportDataRequest): google.cloud.automl.v1.ExportDataRequest; /** - * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. - * @param message TextSnippet message or plain object to encode + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. - * @param message TextSnippet message or plain object to encode + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TextSnippet message from the specified reader or buffer. + * Decodes an ExportDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TextSnippet + * @returns ExportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.TextSnippet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportDataRequest; /** - * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TextSnippet + * @returns ExportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.TextSnippet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportDataRequest; /** - * Verifies a TextSnippet message. + * Verifies an ExportDataRequest message. * @param message Plain 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 TextSnippet message from a plain object. Also converts values to their respective internal types. + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TextSnippet + * @returns ExportDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSnippet; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataRequest; /** - * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. - * @param message TextSnippet + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @param message ExportDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TextSnippet to JSON. + * Converts this ExportDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExamplePayload. */ - interface IExamplePayload { + /** Properties of a GetAnnotationSpecRequest. */ + interface IGetAnnotationSpecRequest { - /** ExamplePayload textSnippet */ - textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + /** GetAnnotationSpecRequest name */ + name?: (string|null); } - /** Represents an ExamplePayload. */ - class ExamplePayload implements IExamplePayload { + /** Represents a GetAnnotationSpecRequest. */ + class GetAnnotationSpecRequest implements IGetAnnotationSpecRequest { /** - * Constructs a new ExamplePayload. + * Constructs a new GetAnnotationSpecRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IExamplePayload); - - /** ExamplePayload textSnippet. */ - public textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + constructor(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest); - /** ExamplePayload payload. */ - public payload?: "textSnippet"; + /** GetAnnotationSpecRequest name. */ + public name: string; /** - * Creates a new ExamplePayload instance using the specified properties. + * Creates a new GetAnnotationSpecRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExamplePayload instance + * @returns GetAnnotationSpecRequest instance */ - public static create(properties?: google.cloud.automl.v1.IExamplePayload): google.cloud.automl.v1.ExamplePayload; + public static create(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest): google.cloud.automl.v1.GetAnnotationSpecRequest; /** - * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. - * @param message ExamplePayload message or plain object to encode + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. - * @param message ExamplePayload message or plain object to encode + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExamplePayload message from the specified reader or buffer. + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExamplePayload + * @returns GetAnnotationSpecRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExamplePayload; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetAnnotationSpecRequest; /** - * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExamplePayload + * @returns GetAnnotationSpecRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExamplePayload; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetAnnotationSpecRequest; /** - * Verifies an ExamplePayload message. + * Verifies a GetAnnotationSpecRequest message. * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExamplePayload + * @returns GetAnnotationSpecRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExamplePayload; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetAnnotationSpecRequest; /** - * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. - * @param message ExamplePayload + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.GetAnnotationSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExamplePayload to JSON. + * Converts this GetAnnotationSpecRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an InputConfig. */ - interface IInputConfig { + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { - /** InputConfig gcsSource */ - gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + /** CreateModelRequest parent */ + parent?: (string|null); - /** InputConfig params */ - params?: ({ [k: string]: string }|null); + /** CreateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); } - /** Represents an InputConfig. */ - class InputConfig implements IInputConfig { + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { /** - * Constructs a new InputConfig. + * Constructs a new CreateModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IInputConfig); - - /** InputConfig gcsSource. */ - public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + constructor(properties?: google.cloud.automl.v1.ICreateModelRequest); - /** InputConfig params. */ - public params: { [k: string]: string }; + /** CreateModelRequest parent. */ + public parent: string; - /** InputConfig source. */ - public source?: "gcsSource"; + /** CreateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); /** - * Creates a new InputConfig instance using the specified properties. + * Creates a new CreateModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns InputConfig instance + * @returns CreateModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IInputConfig): google.cloud.automl.v1.InputConfig; + public static create(properties?: google.cloud.automl.v1.ICreateModelRequest): google.cloud.automl.v1.CreateModelRequest; /** - * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. - * @param message InputConfig message or plain object to encode + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. - * @param message InputConfig message or plain object to encode + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InputConfig message from the specified reader or buffer. + * Decodes a CreateModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InputConfig + * @returns CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.InputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelRequest; /** - * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InputConfig + * @returns CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.InputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelRequest; /** - * Verifies an InputConfig message. + * Verifies a CreateModelRequest message. * @param message Plain 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 InputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InputConfig + * @returns CreateModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.InputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelRequest; /** - * Creates a plain object from an InputConfig message. Also converts values to other types if specified. - * @param message InputConfig + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @param message CreateModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InputConfig to JSON. + * Converts this CreateModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OutputConfig. */ - interface IOutputConfig { + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { - /** OutputConfig gcsDestination */ - gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + /** GetModelRequest name */ + name?: (string|null); } - /** Represents an OutputConfig. */ - class OutputConfig implements IOutputConfig { + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { /** - * Constructs a new OutputConfig. + * Constructs a new GetModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IOutputConfig); - - /** OutputConfig gcsDestination. */ - public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + constructor(properties?: google.cloud.automl.v1.IGetModelRequest); - /** OutputConfig destination. */ - public destination?: "gcsDestination"; + /** GetModelRequest name. */ + public name: string; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new GetModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OutputConfig instance + * @returns GetModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IOutputConfig): google.cloud.automl.v1.OutputConfig; + public static create(properties?: google.cloud.automl.v1.IGetModelRequest): google.cloud.automl.v1.GetModelRequest; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. - * @param message OutputConfig message or plain object to encode + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a GetModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputConfig + * @returns GetModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.OutputConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelRequest; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputConfig + * @returns GetModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.OutputConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelRequest; /** - * Verifies an OutputConfig message. + * Verifies a GetModelRequest message. * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputConfig + * @returns GetModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OutputConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelRequest; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. - * @param message OutputConfig + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputConfig to JSON. + * Converts this GetModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsSource. */ - interface IGcsSource { + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { - /** GcsSource inputUris */ - inputUris?: (string[]|null); + /** ListModelsRequest parent */ + parent?: (string|null); + + /** ListModelsRequest filter */ + filter?: (string|null); + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a GcsSource. */ - class GcsSource implements IGcsSource { + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { /** - * Constructs a new GcsSource. + * Constructs a new ListModelsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IGcsSource); + constructor(properties?: google.cloud.automl.v1.IListModelsRequest); - /** GcsSource inputUris. */ - public inputUris: string[]; + /** ListModelsRequest parent. */ + public parent: string; + + /** ListModelsRequest filter. */ + public filter: string; + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new ListModelsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GcsSource instance + * @returns ListModelsRequest instance */ - public static create(properties?: google.cloud.automl.v1.IGcsSource): google.cloud.automl.v1.GcsSource; + public static create(properties?: google.cloud.automl.v1.IListModelsRequest): google.cloud.automl.v1.ListModelsRequest; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a ListModelsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsSource + * @returns ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GcsSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsRequest; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsSource + * @returns ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GcsSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsRequest; /** - * Verifies a GcsSource message. + * Verifies a ListModelsRequest message. * @param message Plain 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. + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsSource + * @returns ListModelsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GcsSource; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsRequest; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. - * @param message GcsSource + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsSource to JSON. + * Converts this ListModelsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GcsDestination. */ - interface IGcsDestination { + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { - /** GcsDestination outputUriPrefix */ - outputUriPrefix?: (string|null); + /** ListModelsResponse model */ + model?: (google.cloud.automl.v1.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GcsDestination. */ - class GcsDestination implements IGcsDestination { + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { /** - * Constructs a new GcsDestination. + * Constructs a new ListModelsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IGcsDestination); + constructor(properties?: google.cloud.automl.v1.IListModelsResponse); - /** GcsDestination outputUriPrefix. */ - public outputUriPrefix: string; + /** ListModelsResponse model. */ + public model: google.cloud.automl.v1.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GcsDestination instance using the specified properties. + * Creates a new ListModelsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GcsDestination instance + * @returns ListModelsResponse instance */ - public static create(properties?: google.cloud.automl.v1.IGcsDestination): google.cloud.automl.v1.GcsDestination; + public static create(properties?: google.cloud.automl.v1.IListModelsResponse): google.cloud.automl.v1.ListModelsResponse; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. - * @param message GcsDestination message or plain object to encode + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListModelsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GcsDestination + * @returns ListModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GcsDestination; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelsResponse; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GcsDestination + * @returns ListModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GcsDestination; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelsResponse; /** - * Verifies a GcsDestination message. + * Verifies a ListModelsResponse message. * @param message Plain 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GcsDestination + * @returns ListModelsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GcsDestination; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsResponse; /** - * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. - * @param message GcsDestination + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GcsDestination to JSON. + * Converts this ListModelsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Dataset. */ - interface IDataset { - - /** Dataset translationDatasetMetadata */ - translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { - /** Dataset name */ + /** DeleteModelRequest name */ name?: (string|null); - - /** Dataset displayName */ - displayName?: (string|null); - - /** Dataset description */ - description?: (string|null); - - /** Dataset exampleCount */ - exampleCount?: (number|null); - - /** Dataset createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Dataset etag */ - etag?: (string|null); - - /** Dataset labels */ - labels?: ({ [k: string]: string }|null); } - /** Represents a Dataset. */ - class Dataset implements IDataset { + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { /** - * Constructs a new Dataset. + * Constructs a new DeleteModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IDataset); - - /** Dataset translationDatasetMetadata. */ - public translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + constructor(properties?: google.cloud.automl.v1.IDeleteModelRequest); - /** Dataset name. */ + /** DeleteModelRequest name. */ public name: string; - /** Dataset displayName. */ - public displayName: string; - - /** Dataset description. */ - public description: string; - - /** Dataset exampleCount. */ - public exampleCount: number; - - /** Dataset createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Dataset etag. */ - public etag: string; - - /** Dataset labels. */ - public labels: { [k: string]: string }; - - /** Dataset datasetMetadata. */ - public datasetMetadata?: "translationDatasetMetadata"; - /** - * Creates a new Dataset instance using the specified properties. + * Creates a new DeleteModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Dataset instance + * @returns DeleteModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IDataset): google.cloud.automl.v1.Dataset; + public static create(properties?: google.cloud.automl.v1.IDeleteModelRequest): google.cloud.automl.v1.DeleteModelRequest; /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Dataset message from the specified reader or buffer. + * Decodes a DeleteModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Dataset + * @returns DeleteModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Dataset; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteModelRequest; /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Dataset + * @returns DeleteModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Dataset; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteModelRequest; /** - * Verifies a Dataset message. + * Verifies a DeleteModelRequest message. * @param message Plain 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 Dataset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Dataset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Dataset; - - /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. - * @param message Dataset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.automl.v1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Dataset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Model. */ - interface IModel { - - /** Model translationModelMetadata */ - translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); - - /** Model name */ - name?: (string|null); - - /** Model displayName */ - displayName?: (string|null); - - /** Model datasetId */ - datasetId?: (string|null); - - /** Model createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Model updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Model deploymentState */ - deploymentState?: (google.cloud.automl.v1.Model.DeploymentState|null); - - /** Model labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Model. */ - class Model implements IModel { + public static verify(message: { [k: string]: any }): (string|null); /** - * Constructs a new Model. - * @param [properties] Properties to set + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest */ - constructor(properties?: google.cloud.automl.v1.IModel); + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteModelRequest; - /** Model translationModelMetadata. */ - public translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Model name. */ - public name: string; + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Model displayName. */ - public displayName: string; + /** Properties of an UpdateModelRequest. */ + interface IUpdateModelRequest { - /** Model datasetId. */ - public datasetId: string; + /** UpdateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); - /** Model createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** UpdateModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** Model updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** Represents an UpdateModelRequest. */ + class UpdateModelRequest implements IUpdateModelRequest { - /** Model deploymentState. */ - public deploymentState: google.cloud.automl.v1.Model.DeploymentState; + /** + * Constructs a new UpdateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUpdateModelRequest); - /** Model labels. */ - public labels: { [k: string]: string }; + /** UpdateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); - /** Model modelMetadata. */ - public modelMetadata?: "translationModelMetadata"; + /** UpdateModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new Model instance using the specified properties. + * Creates a new UpdateModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Model instance + * @returns UpdateModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IModel): google.cloud.automl.v1.Model; + public static create(properties?: google.cloud.automl.v1.IUpdateModelRequest): google.cloud.automl.v1.UpdateModelRequest; /** - * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. - * @param message Model message or plain object to encode + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. - * @param message Model message or plain object to encode + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Model message from the specified reader or buffer. + * Decodes an UpdateModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Model + * @returns UpdateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.Model; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UpdateModelRequest; /** - * Decodes a Model message from the specified reader or buffer, length delimited. + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Model + * @returns UpdateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.Model; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UpdateModelRequest; /** - * Verifies a Model message. + * Verifies an UpdateModelRequest message. * @param message Plain 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 Model message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Model + * @returns UpdateModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Model; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateModelRequest; /** - * Creates a plain object from a Model message. Also converts values to other types if specified. - * @param message Model + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @param message UpdateModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Model to JSON. + * Converts this UpdateModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Model { - - /** DeploymentState enum. */ - enum DeploymentState { - DEPLOYMENT_STATE_UNSPECIFIED = 0, - DEPLOYED = 1, - UNDEPLOYED = 2 - } - } + /** Properties of a DeployModelRequest. */ + interface IDeployModelRequest { - /** Properties of a ModelEvaluation. */ - interface IModelEvaluation { + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata */ + imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); - /** ModelEvaluation translationEvaluationMetrics */ - translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + /** DeployModelRequest imageClassificationModelDeploymentMetadata */ + imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); - /** ModelEvaluation name */ + /** DeployModelRequest name */ name?: (string|null); - - /** ModelEvaluation annotationSpecId */ - annotationSpecId?: (string|null); - - /** ModelEvaluation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ModelEvaluation evaluatedExampleCount */ - evaluatedExampleCount?: (number|null); } - /** Represents a ModelEvaluation. */ - class ModelEvaluation implements IModelEvaluation { + /** Represents a DeployModelRequest. */ + class DeployModelRequest implements IDeployModelRequest { /** - * Constructs a new ModelEvaluation. + * Constructs a new DeployModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IModelEvaluation); - - /** ModelEvaluation translationEvaluationMetrics. */ - public translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + constructor(properties?: google.cloud.automl.v1.IDeployModelRequest); - /** ModelEvaluation name. */ - public name: string; - - /** ModelEvaluation annotationSpecId. */ - public annotationSpecId: string; + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata. */ + public imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); - /** ModelEvaluation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** DeployModelRequest imageClassificationModelDeploymentMetadata. */ + public imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); - /** ModelEvaluation evaluatedExampleCount. */ - public evaluatedExampleCount: number; + /** DeployModelRequest name. */ + public name: string; - /** ModelEvaluation metrics. */ - public metrics?: "translationEvaluationMetrics"; + /** DeployModelRequest modelDeploymentMetadata. */ + public modelDeploymentMetadata?: ("imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"); /** - * Creates a new ModelEvaluation instance using the specified properties. + * Creates a new DeployModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ModelEvaluation instance + * @returns DeployModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IModelEvaluation): google.cloud.automl.v1.ModelEvaluation; + public static create(properties?: google.cloud.automl.v1.IDeployModelRequest): google.cloud.automl.v1.DeployModelRequest; /** - * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. - * @param message ModelEvaluation message or plain object to encode + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. - * @param message ModelEvaluation message or plain object to encode + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ModelEvaluation message from the specified reader or buffer. + * Decodes a DeployModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ModelEvaluation + * @returns DeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ModelEvaluation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeployModelRequest; /** - * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ModelEvaluation + * @returns DeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ModelEvaluation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeployModelRequest; /** - * Verifies a ModelEvaluation message. + * Verifies a DeployModelRequest message. * @param message Plain 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 ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ModelEvaluation + * @returns DeployModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelEvaluation; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelRequest; /** - * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. - * @param message ModelEvaluation + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @param message DeployModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.DeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ModelEvaluation to JSON. + * Converts this DeployModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata deleteDetails */ - deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); - - /** OperationMetadata createModelDetails */ - createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); - - /** OperationMetadata progressPercent */ - progressPercent?: (number|null); - - /** OperationMetadata partialFailures */ - partialFailures?: (google.rpc.IStatus[]|null); - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Properties of an UndeployModelRequest. */ + interface IUndeployModelRequest { - /** OperationMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** UndeployModelRequest name */ + name?: (string|null); } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Represents an UndeployModelRequest. */ + class UndeployModelRequest implements IUndeployModelRequest { /** - * Constructs a new OperationMetadata. + * Constructs a new UndeployModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IOperationMetadata); - - /** OperationMetadata deleteDetails. */ - public deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); - - /** OperationMetadata createModelDetails. */ - public createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); - - /** OperationMetadata progressPercent. */ - public progressPercent: number; - - /** OperationMetadata partialFailures. */ - public partialFailures: google.rpc.IStatus[]; - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.automl.v1.IUndeployModelRequest); - /** OperationMetadata details. */ - public details?: ("deleteDetails"|"createModelDetails"); + /** UndeployModelRequest name. */ + public name: string; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new UndeployModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns UndeployModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IOperationMetadata): google.cloud.automl.v1.OperationMetadata; + public static create(properties?: google.cloud.automl.v1.IUndeployModelRequest): google.cloud.automl.v1.UndeployModelRequest; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes an UndeployModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns UndeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.UndeployModelRequest; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns UndeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.UndeployModelRequest; /** - * Verifies an OperationMetadata message. + * Verifies an UndeployModelRequest message. * @param message Plain 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. + * Creates an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns UndeployModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelRequest; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @param message UndeployModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.UndeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this UndeployModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteOperationMetadata. */ - interface IDeleteOperationMetadata { + /** Properties of an ExportModelRequest. */ + interface IExportModelRequest { + + /** ExportModelRequest name */ + name?: (string|null); + + /** ExportModelRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); } - /** Represents a DeleteOperationMetadata. */ - class DeleteOperationMetadata implements IDeleteOperationMetadata { + /** Represents an ExportModelRequest. */ + class ExportModelRequest implements IExportModelRequest { /** - * Constructs a new DeleteOperationMetadata. + * Constructs a new ExportModelRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IDeleteOperationMetadata); + constructor(properties?: google.cloud.automl.v1.IExportModelRequest); + + /** ExportModelRequest name. */ + public name: string; + + /** ExportModelRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); /** - * Creates a new DeleteOperationMetadata instance using the specified properties. + * Creates a new ExportModelRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteOperationMetadata instance + * @returns ExportModelRequest instance */ - public static create(properties?: google.cloud.automl.v1.IDeleteOperationMetadata): google.cloud.automl.v1.DeleteOperationMetadata; + public static create(properties?: google.cloud.automl.v1.IExportModelRequest): google.cloud.automl.v1.ExportModelRequest; /** - * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. - * @param message DeleteOperationMetadata message or plain object to encode + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. - * @param message DeleteOperationMetadata message or plain object to encode + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * Decodes an ExportModelRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteOperationMetadata + * @returns ExportModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.DeleteOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ExportModelRequest; /** - * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteOperationMetadata + * @returns ExportModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.DeleteOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ExportModelRequest; /** - * Verifies a DeleteOperationMetadata message. + * Verifies an ExportModelRequest message. * @param message Plain 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 DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteOperationMetadata + * @returns ExportModelRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelRequest; /** - * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. - * @param message DeleteOperationMetadata + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @param message ExportModelRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ExportModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteOperationMetadata to JSON. + * Converts this ExportModelRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateModelOperationMetadata. */ - interface ICreateModelOperationMetadata { + /** Properties of a GetModelEvaluationRequest. */ + interface IGetModelEvaluationRequest { + + /** GetModelEvaluationRequest name */ + name?: (string|null); } - /** Represents a CreateModelOperationMetadata. */ - class CreateModelOperationMetadata implements ICreateModelOperationMetadata { + /** Represents a GetModelEvaluationRequest. */ + class GetModelEvaluationRequest implements IGetModelEvaluationRequest { /** - * Constructs a new CreateModelOperationMetadata. + * Constructs a new GetModelEvaluationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata); + constructor(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest); + + /** GetModelEvaluationRequest name. */ + public name: string; /** - * Creates a new CreateModelOperationMetadata instance using the specified properties. + * Creates a new GetModelEvaluationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateModelOperationMetadata instance + * @returns GetModelEvaluationRequest instance */ - public static create(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata): google.cloud.automl.v1.CreateModelOperationMetadata; + public static create(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest): google.cloud.automl.v1.GetModelEvaluationRequest; /** - * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. - * @param message CreateModelOperationMetadata message or plain object to encode + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. - * @param message CreateModelOperationMetadata message or plain object to encode + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateModelOperationMetadata + * @returns GetModelEvaluationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.CreateModelOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.GetModelEvaluationRequest; /** - * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateModelOperationMetadata + * @returns GetModelEvaluationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.CreateModelOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.GetModelEvaluationRequest; /** - * Verifies a CreateModelOperationMetadata message. + * Verifies a GetModelEvaluationRequest message. * @param message Plain 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 CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateModelOperationMetadata + * @returns GetModelEvaluationRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelEvaluationRequest; /** - * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. - * @param message CreateModelOperationMetadata + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @param message GetModelEvaluationRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateModelOperationMetadata to JSON. + * Converts this GetModelEvaluationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a PredictionService */ - class PredictionService extends $protobuf.rpc.Service { - - /** - * Constructs a new PredictionService 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 PredictionService 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): PredictionService; - - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @param callback Node-style callback called with the error, if any, and PredictResponse - */ - public predict(request: google.cloud.automl.v1.IPredictRequest, callback: google.cloud.automl.v1.PredictionService.PredictCallback): void; - - /** - * Calls Predict. - * @param request PredictRequest message or plain object - * @returns Promise - */ - public predict(request: google.cloud.automl.v1.IPredictRequest): Promise; - } - - namespace PredictionService { - - /** - * Callback as used by {@link google.cloud.automl.v1.PredictionService#predict}. - * @param error Error, if any - * @param [response] PredictResponse - */ - type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1.PredictResponse) => void; - } + /** Properties of a ListModelEvaluationsRequest. */ + interface IListModelEvaluationsRequest { - /** Properties of a PredictRequest. */ - interface IPredictRequest { + /** ListModelEvaluationsRequest parent */ + parent?: (string|null); - /** PredictRequest name */ - name?: (string|null); + /** ListModelEvaluationsRequest filter */ + filter?: (string|null); - /** PredictRequest payload */ - payload?: (google.cloud.automl.v1.IExamplePayload|null); + /** ListModelEvaluationsRequest pageSize */ + pageSize?: (number|null); - /** PredictRequest params */ - params?: ({ [k: string]: string }|null); + /** ListModelEvaluationsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a PredictRequest. */ - class PredictRequest implements IPredictRequest { + /** Represents a ListModelEvaluationsRequest. */ + class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { /** - * Constructs a new PredictRequest. + * Constructs a new ListModelEvaluationsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IPredictRequest); + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest); - /** PredictRequest name. */ - public name: string; + /** ListModelEvaluationsRequest parent. */ + public parent: string; - /** PredictRequest payload. */ - public payload?: (google.cloud.automl.v1.IExamplePayload|null); + /** ListModelEvaluationsRequest filter. */ + public filter: string; - /** PredictRequest params. */ - public params: { [k: string]: string }; + /** ListModelEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListModelEvaluationsRequest pageToken. */ + public pageToken: string; /** - * Creates a new PredictRequest instance using the specified properties. + * Creates a new ListModelEvaluationsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PredictRequest instance + * @returns ListModelEvaluationsRequest instance */ - public static create(properties?: google.cloud.automl.v1.IPredictRequest): google.cloud.automl.v1.PredictRequest; + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest): google.cloud.automl.v1.ListModelEvaluationsRequest; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. - * @param message PredictRequest message or plain object to encode + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictRequest + * @returns ListModelEvaluationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsRequest; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictRequest + * @returns ListModelEvaluationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsRequest; /** - * Verifies a PredictRequest message. + * Verifies a ListModelEvaluationsRequest message. * @param message Plain 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 PredictRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictRequest + * @returns ListModelEvaluationsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsRequest; /** - * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. - * @param message PredictRequest + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListModelEvaluationsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictRequest to JSON. + * Converts this ListModelEvaluationsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PredictResponse. */ - interface IPredictResponse { + /** Properties of a ListModelEvaluationsResponse. */ + interface IListModelEvaluationsResponse { - /** PredictResponse payload */ - payload?: (google.cloud.automl.v1.IAnnotationPayload[]|null); + /** ListModelEvaluationsResponse modelEvaluation */ + modelEvaluation?: (google.cloud.automl.v1.IModelEvaluation[]|null); - /** PredictResponse metadata */ - metadata?: ({ [k: string]: string }|null); + /** ListModelEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a PredictResponse. */ - class PredictResponse implements IPredictResponse { + /** Represents a ListModelEvaluationsResponse. */ + class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { /** - * Constructs a new PredictResponse. + * Constructs a new ListModelEvaluationsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.automl.v1.IPredictResponse); + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse); - /** PredictResponse payload. */ - public payload: google.cloud.automl.v1.IAnnotationPayload[]; + /** ListModelEvaluationsResponse modelEvaluation. */ + public modelEvaluation: google.cloud.automl.v1.IModelEvaluation[]; - /** PredictResponse metadata. */ - public metadata: { [k: string]: string }; + /** ListModelEvaluationsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new ListModelEvaluationsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns PredictResponse instance + * @returns ListModelEvaluationsResponse instance */ - public static create(properties?: google.cloud.automl.v1.IPredictResponse): google.cloud.automl.v1.PredictResponse; + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse): google.cloud.automl.v1.ListModelEvaluationsResponse; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. - * @param message PredictResponse message or plain object to encode + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PredictResponse + * @returns ListModelEvaluationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.PredictResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1.ListModelEvaluationsResponse; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PredictResponse + * @returns ListModelEvaluationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.PredictResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1.ListModelEvaluationsResponse; /** - * Verifies a PredictResponse message. + * Verifies a ListModelEvaluationsResponse message. * @param message Plain 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 PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PredictResponse + * @returns ListModelEvaluationsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsResponse; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. - * @param message PredictResponse + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListModelEvaluationsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.automl.v1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PredictResponse to JSON. + * Converts this ListModelEvaluationsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -9167,6 +14824,12 @@ export namespace google { /** Properties of a TablesModelMetadata. */ interface ITablesModelMetadata { + /** TablesModelMetadata optimizationObjectiveRecallValue */ + optimizationObjectiveRecallValue?: (number|null); + + /** TablesModelMetadata optimizationObjectivePrecisionValue */ + optimizationObjectivePrecisionValue?: (number|null); + /** TablesModelMetadata targetColumnSpec */ targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); @@ -9198,6 +14861,12 @@ export namespace google { */ constructor(properties?: google.cloud.automl.v1beta1.ITablesModelMetadata); + /** TablesModelMetadata optimizationObjectiveRecallValue. */ + public optimizationObjectiveRecallValue: number; + + /** TablesModelMetadata optimizationObjectivePrecisionValue. */ + public optimizationObjectivePrecisionValue: number; + /** TablesModelMetadata targetColumnSpec. */ public targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); @@ -9219,6 +14888,9 @@ export namespace google { /** TablesModelMetadata disableEarlyStopping. */ public disableEarlyStopping: boolean; + /** TablesModelMetadata additionalOptimizationObjectiveConfig. */ + public additionalOptimizationObjectiveConfig?: ("optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"); + /** * Creates a new TablesModelMetadata instance using the specified properties. * @param [properties] Properties to set @@ -14623,6 +20295,12 @@ export namespace google { /** ImageClassificationModelMetadata modelType */ modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|null); } /** Represents an ImageClassificationModelMetadata. */ @@ -14649,6 +20327,12 @@ export namespace google { /** ImageClassificationModelMetadata modelType. */ public modelType: string; + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long); + /** * Creates a new ImageClassificationModelMetadata instance using the specified properties. * @param [properties] Properties to set @@ -15112,6 +20796,9 @@ export namespace google { /** Properties of a TextClassificationModelMetadata. */ interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|null); } /** Represents a TextClassificationModelMetadata. */ @@ -15123,6 +20810,9 @@ export namespace google { */ constructor(properties?: google.cloud.automl.v1beta1.ITextClassificationModelMetadata); + /** TextClassificationModelMetadata classificationType. */ + public classificationType: google.cloud.automl.v1beta1.ClassificationType; + /** * Creates a new TextClassificationModelMetadata instance using the specified properties. * @param [properties] Properties to set @@ -18229,49 +23919,263 @@ export namespace google { */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.automl.v1beta1.BatchPredictResult; - /** - * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchPredictResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictResult; + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Verifies a BatchPredictResult message. + * @param message Plain 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 BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: google.api.ResourceDescriptor.History; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - /** - * Verifies a BatchPredictResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a ResourceReference message. + * @param message Plain 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 BatchPredictResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchPredictResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictResult; + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - /** - * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. - * @param message BatchPredictResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.automl.v1beta1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this BatchPredictResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - } - - /** Namespace api. */ - namespace api { /** Properties of a Http. */ interface IHttp { @@ -18611,6 +24515,16 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } } /** Namespace protobuf. */ @@ -20343,6 +26257,9 @@ export namespace google { /** MessageOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } /** Represents a MessageOptions. */ @@ -20463,6 +26380,12 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); } /** Represents a FieldOptions. */ @@ -21727,6 +27650,102 @@ export namespace google { } } + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an Any. */ interface IAny { @@ -22159,165 +28178,69 @@ export namespace google { /** * Creates a new ListValue instance using the specified properties. * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain 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 ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance + * @returns ListValue instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes a ListValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Timestamp + * @returns ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a ListValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @returns ListValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; /** - * Verifies a Timestamp message. + * Verifies a ListValue message. * @param message Plain 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns ListValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this ListValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -22498,112 +28421,6 @@ export namespace google { } } - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain 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 Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - /** Namespace longrunning. */ namespace longrunning { @@ -23519,4 +29336,110 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } diff --git a/packages/google-cloud-automl/protos/protos.js b/packages/google-cloud-automl/protos/protos.js index 33fb46006c1..61c01091d63 100644 --- a/packages/google-cloud-automl/protos/protos.js +++ b/packages/google-cloud-automl/protos/protos.js @@ -52,522 +52,628 @@ */ var v1 = {}; - v1.AutoMl = (function() { + v1.OperationMetadata = (function() { /** - * Constructs a new AutoMl service. + * Properties of an OperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents an AutoMl - * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; - - /** - * Creates new AutoMl service using the specified rpc implementation. - * @function create - * @memberof google.cloud.automl.v1.AutoMl - * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. - */ - AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#createDataset}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef CreateDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateDataset. - * @function createDataset - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { - return this.rpcCall(createDataset, $root.google.cloud.automl.v1.CreateDatasetRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateDataset" }); - - /** - * Calls CreateDataset. - * @function createDataset - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getDataset}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef GetDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.Dataset} [response] Dataset + * @interface IOperationMetadata + * @property {google.cloud.automl.v1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails + * @property {google.cloud.automl.v1.IDeployModelOperationMetadata|null} [deployModelDetails] OperationMetadata deployModelDetails + * @property {google.cloud.automl.v1.IUndeployModelOperationMetadata|null} [undeployModelDetails] OperationMetadata undeployModelDetails + * @property {google.cloud.automl.v1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails + * @property {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null} [createDatasetDetails] OperationMetadata createDatasetDetails + * @property {google.cloud.automl.v1.IImportDataOperationMetadata|null} [importDataDetails] OperationMetadata importDataDetails + * @property {google.cloud.automl.v1.IBatchPredictOperationMetadata|null} [batchPredictDetails] OperationMetadata batchPredictDetails + * @property {google.cloud.automl.v1.IExportDataOperationMetadata|null} [exportDataDetails] OperationMetadata exportDataDetails + * @property {google.cloud.automl.v1.IExportModelOperationMetadata|null} [exportModelDetails] OperationMetadata exportModelDetails + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {Array.|null} [partialFailures] OperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime */ /** - * Calls GetDataset. - * @function getDataset - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset - * @returns {undefined} - * @variation 1 + * Constructs a new OperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set */ - Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { - return this.rpcCall(getDataset, $root.google.cloud.automl.v1.GetDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); - }, "name", { value: "GetDataset" }); + function OperationMetadata(properties) { + this.partialFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetDataset. - * @function getDataset - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata deleteDetails. + * @member {google.cloud.automl.v1.IDeleteOperationMetadata|null|undefined} deleteDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listDatasets}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef ListDatasetsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.ListDatasetsResponse} [response] ListDatasetsResponse */ + OperationMetadata.prototype.deleteDetails = null; /** - * Calls ListDatasets. - * @function listDatasets - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata deployModelDetails. + * @member {google.cloud.automl.v1.IDeployModelOperationMetadata|null|undefined} deployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { - return this.rpcCall(listDatasets, $root.google.cloud.automl.v1.ListDatasetsRequest, $root.google.cloud.automl.v1.ListDatasetsResponse, request, callback); - }, "name", { value: "ListDatasets" }); + OperationMetadata.prototype.deployModelDetails = null; /** - * Calls ListDatasets. - * @function listDatasets - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata undeployModelDetails. + * @member {google.cloud.automl.v1.IUndeployModelOperationMetadata|null|undefined} undeployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateDataset}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef UpdateDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.Dataset} [response] Dataset */ + OperationMetadata.prototype.undeployModelDetails = null; /** - * Calls UpdateDataset. - * @function updateDataset - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata createModelDetails. + * @member {google.cloud.automl.v1.ICreateModelOperationMetadata|null|undefined} createModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { - return this.rpcCall(updateDataset, $root.google.cloud.automl.v1.UpdateDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); - }, "name", { value: "UpdateDataset" }); + OperationMetadata.prototype.createModelDetails = null; /** - * Calls UpdateDataset. - * @function updateDataset - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata createDatasetDetails. + * @member {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null|undefined} createDatasetDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteDataset}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef DeleteDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + OperationMetadata.prototype.createDatasetDetails = null; /** - * Calls DeleteDataset. - * @function deleteDataset - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata importDataDetails. + * @member {google.cloud.automl.v1.IImportDataOperationMetadata|null|undefined} importDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { - return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteDataset" }); + OperationMetadata.prototype.importDataDetails = null; /** - * Calls DeleteDataset. - * @function deleteDataset - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata batchPredictDetails. + * @member {google.cloud.automl.v1.IBatchPredictOperationMetadata|null|undefined} batchPredictDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#importData}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef ImportDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + OperationMetadata.prototype.batchPredictDetails = null; /** - * Calls ImportData. - * @function importData - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata exportDataDetails. + * @member {google.cloud.automl.v1.IExportDataOperationMetadata|null|undefined} exportDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { - return this.rpcCall(importData, $root.google.cloud.automl.v1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportData" }); + OperationMetadata.prototype.exportDataDetails = null; /** - * Calls ImportData. - * @function importData - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata exportModelDetails. + * @member {google.cloud.automl.v1.IExportModelOperationMetadata|null|undefined} exportModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportData}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef ExportDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + OperationMetadata.prototype.exportModelDetails = null; /** - * Calls ExportData. - * @function exportData - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { - return this.rpcCall(exportData, $root.google.cloud.automl.v1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportData" }); + OperationMetadata.prototype.progressPercent = 0; /** - * Calls ExportData. - * @function exportData - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#createModel}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef CreateModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + OperationMetadata.prototype.partialFailures = $util.emptyArray; /** - * Calls CreateModel. - * @function createModel - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { - return this.rpcCall(createModel, $root.google.cloud.automl.v1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateModel" }); + OperationMetadata.prototype.createTime = null; /** - * Calls CreateModel. - * @function createModel - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModel}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef GetModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.Model} [response] Model */ + OperationMetadata.prototype.updateTime = null; - /** - * Calls GetModel. - * @function getModel - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { - return this.rpcCall(getModel, $root.google.cloud.automl.v1.GetModelRequest, $root.google.cloud.automl.v1.Model, request, callback); - }, "name", { value: "GetModel" }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls GetModel. - * @function getModel - * @memberof google.cloud.automl.v1.AutoMl + * OperationMetadata details. + * @member {"deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|undefined} details + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(OperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "deployModelDetails", "undeployModelDetails", "createModelDetails", "createDatasetDetails", "importDataDetails", "batchPredictDetails", "exportDataDetails", "exportModelDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModels}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef ListModelsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.ListModelsResponse} [response] ListModelsResponse + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata instance */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; /** - * Calls ListModels. - * @function listModels - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { - return this.rpcCall(listModels, $root.google.cloud.automl.v1.ListModelsRequest, $root.google.cloud.automl.v1.ListModelsResponse, request, callback); - }, "name", { value: "ListModels" }); + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) + $root.google.cloud.automl.v1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) + $root.google.cloud.automl.v1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) + $root.google.cloud.automl.v1.ImportDataOperationMetadata.encode(message.importDataDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.encode(message.batchPredictDetails, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.encode(message.exportDataDetails, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.encode(message.exportModelDetails, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) + $root.google.cloud.automl.v1.DeployModelOperationMetadata.encode(message.deployModelDetails, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) + $root.google.cloud.automl.v1.UndeployModelOperationMetadata.encode(message.undeployModelDetails, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) + $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.encode(message.createDatasetDetails, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; /** - * Calls ListModels. - * @function listModels - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.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(); + }; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteModel}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef DeleteModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.decode(reader, reader.uint32()); + break; + case 24: + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + case 25: + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + case 10: + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.decode(reader, reader.uint32()); + break; + case 30: + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.decode(reader, reader.uint32()); + break; + case 15: + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.decode(reader, reader.uint32()); + break; + case 16: + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.decode(reader, reader.uint32()); + break; + case 21: + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.decode(reader, reader.uint32()); + break; + case 22: + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.decode(reader, reader.uint32()); + break; + case 13: + message.progressPercent = reader.int32(); + break; + case 2: + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteModel. - * @function deleteModel - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { - return this.rpcCall(deleteModel, $root.google.cloud.automl.v1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteModel" }); + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteModel. - * @function deleteModel - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateModel}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef UpdateModelCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.Model} [response] Model - */ - - /** - * Calls UpdateModel. - * @function updateModel - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoMl.prototype.updateModel = function updateModel(request, callback) { - return this.rpcCall(updateModel, $root.google.cloud.automl.v1.UpdateModelRequest, $root.google.cloud.automl.v1.Model, request, callback); - }, "name", { value: "UpdateModel" }); - - /** - * Calls UpdateModel. - * @function updateModel - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModelEvaluation}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef GetModelEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.ModelEvaluation} [response] ModelEvaluation - */ - - /** - * Calls GetModelEvaluation. - * @function getModelEvaluation - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { - return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1.GetModelEvaluationRequest, $root.google.cloud.automl.v1.ModelEvaluation, request, callback); - }, "name", { value: "GetModelEvaluation" }); - - /** - * Calls GetModelEvaluation. - * @function getModelEvaluation - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeleteOperationMetadata.verify(message.deleteDetails); + if (error) + return "deleteDetails." + error; + } + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeployModelOperationMetadata.verify(message.deployModelDetails); + if (error) + return "deployModelDetails." + error; + } + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.verify(message.undeployModelDetails); + if (error) + return "undeployModelDetails." + error; + } + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateModelOperationMetadata.verify(message.createModelDetails); + if (error) + return "createModelDetails." + error; + } + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.verify(message.createDatasetDetails); + if (error) + return "createDatasetDetails." + error; + } + } + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ImportDataOperationMetadata.verify(message.importDataDetails); + if (error) + return "importDataDetails." + error; + } + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.verify(message.batchPredictDetails); + if (error) + return "batchPredictDetails." + error; + } + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.verify(message.exportDataDetails); + if (error) + return "exportDataDetails." + error; + } + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.verify(message.exportModelDetails); + if (error) + return "exportModelDetails." + error; + } + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModelEvaluations}. - * @memberof google.cloud.automl.v1.AutoMl - * @typedef ListModelEvaluationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.OperationMetadata(); + if (object.deleteDetails != null) { + if (typeof object.deleteDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deleteDetails: object expected"); + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.fromObject(object.deleteDetails); + } + if (object.deployModelDetails != null) { + if (typeof object.deployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deployModelDetails: object expected"); + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.fromObject(object.deployModelDetails); + } + if (object.undeployModelDetails != null) { + if (typeof object.undeployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.undeployModelDetails: object expected"); + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.fromObject(object.undeployModelDetails); + } + if (object.createModelDetails != null) { + if (typeof object.createModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createModelDetails: object expected"); + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.fromObject(object.createModelDetails); + } + if (object.createDatasetDetails != null) { + if (typeof object.createDatasetDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createDatasetDetails: object expected"); + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.fromObject(object.createDatasetDetails); + } + if (object.importDataDetails != null) { + if (typeof object.importDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.importDataDetails: object expected"); + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.fromObject(object.importDataDetails); + } + if (object.batchPredictDetails != null) { + if (typeof object.batchPredictDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.batchPredictDetails: object expected"); + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.fromObject(object.batchPredictDetails); + } + if (object.exportDataDetails != null) { + if (typeof object.exportDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportDataDetails: object expected"); + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.fromObject(object.exportDataDetails); + } + if (object.exportModelDetails != null) { + if (typeof object.exportModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportModelDetails: object expected"); + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.fromObject(object.exportModelDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; /** - * Calls ListModelEvaluations. - * @function listModelEvaluations - * @memberof google.cloud.automl.v1.AutoMl - * @instance - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object - * @param {google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { - return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1.ListModelEvaluationsResponse, request, callback); - }, "name", { value: "ListModelEvaluations" }); + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.progressPercent = 0; + } + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); + } + 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); + if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + object.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + if (options.oneofs) + object.details = "deleteDetails"; + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + object.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (options.oneofs) + object.details = "createModelDetails"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + object.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.toObject(message.importDataDetails, options); + if (options.oneofs) + object.details = "importDataDetails"; + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + object.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.toObject(message.batchPredictDetails, options); + if (options.oneofs) + object.details = "batchPredictDetails"; + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + object.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.toObject(message.exportDataDetails, options); + if (options.oneofs) + object.details = "exportDataDetails"; + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + object.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.toObject(message.exportModelDetails, options); + if (options.oneofs) + object.details = "exportModelDetails"; + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + object.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.toObject(message.deployModelDetails, options); + if (options.oneofs) + object.details = "deployModelDetails"; + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + object.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.toObject(message.undeployModelDetails, options); + if (options.oneofs) + object.details = "undeployModelDetails"; + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + object.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.toObject(message.createDatasetDetails, options); + if (options.oneofs) + object.details = "createDatasetDetails"; + } + return object; + }; /** - * Calls ListModelEvaluations. - * @function listModelEvaluations - * @memberof google.cloud.automl.v1.AutoMl + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.OperationMetadata * @instance - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AutoMl; + return OperationMetadata; })(); - v1.CreateDatasetRequest = (function() { + v1.DeleteOperationMetadata = (function() { /** - * Properties of a CreateDatasetRequest. + * Properties of a DeleteOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface ICreateDatasetRequest - * @property {string|null} [parent] CreateDatasetRequest parent - * @property {google.cloud.automl.v1.IDataset|null} [dataset] CreateDatasetRequest dataset + * @interface IDeleteOperationMetadata */ /** - * Constructs a new CreateDatasetRequest. + * Constructs a new DeleteOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a CreateDatasetRequest. - * @implements ICreateDatasetRequest + * @classdesc Represents a DeleteOperationMetadata. + * @implements IDeleteOperationMetadata * @constructor - * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set */ - function CreateDatasetRequest(properties) { + function DeleteOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -575,89 +681,63 @@ } /** - * CreateDatasetRequest parent. - * @member {string} parent - * @memberof google.cloud.automl.v1.CreateDatasetRequest - * @instance - */ - CreateDatasetRequest.prototype.parent = ""; - - /** - * CreateDatasetRequest dataset. - * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset - * @memberof google.cloud.automl.v1.CreateDatasetRequest - * @instance - */ - CreateDatasetRequest.prototype.dataset = null; - - /** - * Creates a new CreateDatasetRequest instance using the specified properties. + * Creates a new DeleteOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static - * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest instance + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata instance */ - CreateDatasetRequest.create = function create(properties) { - return new CreateDatasetRequest(properties); + DeleteOperationMetadata.create = function create(properties) { + return new DeleteOperationMetadata(properties); }; /** - * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static - * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDatasetRequest.encode = function encode(message, writer) { + DeleteOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.dataset != null && message.hasOwnProperty("dataset")) - $root.google.cloud.automl.v1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static - * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDatasetRequest.decode = function decode(reader, length) { + DeleteOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.dataset = $root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -667,121 +747,93 @@ }; /** - * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateDatasetRequest message. + * Verifies a DeleteOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateDatasetRequest.verify = function verify(message) { + DeleteOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) { - var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); - if (error) - return "dataset." + error; - } return null; }; /** - * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata */ - CreateDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.CreateDatasetRequest) + DeleteOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.dataset != null) { - if (typeof object.dataset !== "object") - throw TypeError(".google.cloud.automl.v1.CreateDatasetRequest.dataset: object expected"); - message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); - } - return message; + return new $root.google.cloud.automl.v1.DeleteOperationMetadata(); }; /** - * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @static - * @param {google.cloud.automl.v1.CreateDatasetRequest} message CreateDatasetRequest + * @param {google.cloud.automl.v1.DeleteOperationMetadata} message DeleteOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.dataset = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); - return object; + DeleteOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this CreateDatasetRequest to JSON. + * Converts this DeleteOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @memberof google.cloud.automl.v1.DeleteOperationMetadata * @instance * @returns {Object.} JSON object */ - CreateDatasetRequest.prototype.toJSON = function toJSON() { + DeleteOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateDatasetRequest; + return DeleteOperationMetadata; })(); - v1.GetDatasetRequest = (function() { + v1.DeployModelOperationMetadata = (function() { /** - * Properties of a GetDatasetRequest. + * Properties of a DeployModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IGetDatasetRequest - * @property {string|null} [name] GetDatasetRequest name + * @interface IDeployModelOperationMetadata */ /** - * Constructs a new GetDatasetRequest. + * Constructs a new DeployModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a GetDatasetRequest. - * @implements IGetDatasetRequest + * @classdesc Represents a DeployModelOperationMetadata. + * @implements IDeployModelOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set */ - function GetDatasetRequest(properties) { + function DeployModelOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -789,76 +841,63 @@ } /** - * GetDatasetRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.GetDatasetRequest - * @instance + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata instance */ - GetDatasetRequest.prototype.name = ""; + DeployModelOperationMetadata.create = function create(properties) { + return new DeployModelOperationMetadata(properties); + }; /** - * Creates a new GetDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.automl.v1.GetDatasetRequest - * @static - * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest instance - */ - GetDatasetRequest.create = function create(properties) { - return new GetDatasetRequest(properties); - }; - - /** - * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDatasetRequest.encode = function encode(message, writer) { + DeployModelOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDatasetRequest message from the specified reader or buffer. + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDatasetRequest.decode = function decode(reader, length) { + DeployModelOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetDatasetRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -868,110 +907,93 @@ }; /** - * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + DeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDatasetRequest message. + * Verifies a DeployModelOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDatasetRequest.verify = function verify(message) { + DeployModelOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata */ - GetDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.GetDatasetRequest) + DeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.GetDatasetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); }; /** - * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.GetDatasetRequest} message GetDatasetRequest + * @param {google.cloud.automl.v1.DeployModelOperationMetadata} message DeployModelOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDatasetRequest.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; + DeployModelOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this GetDatasetRequest to JSON. + * Converts this DeployModelOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.GetDatasetRequest + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata * @instance * @returns {Object.} JSON object */ - GetDatasetRequest.prototype.toJSON = function toJSON() { + DeployModelOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDatasetRequest; + return DeployModelOperationMetadata; })(); - v1.ListDatasetsRequest = (function() { + v1.UndeployModelOperationMetadata = (function() { /** - * Properties of a ListDatasetsRequest. + * Properties of an UndeployModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IListDatasetsRequest - * @property {string|null} [parent] ListDatasetsRequest parent - * @property {string|null} [filter] ListDatasetsRequest filter - * @property {number|null} [pageSize] ListDatasetsRequest pageSize - * @property {string|null} [pageToken] ListDatasetsRequest pageToken + * @interface IUndeployModelOperationMetadata */ /** - * Constructs a new ListDatasetsRequest. + * Constructs a new UndeployModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListDatasetsRequest. - * @implements IListDatasetsRequest + * @classdesc Represents an UndeployModelOperationMetadata. + * @implements IUndeployModelOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set */ - function ListDatasetsRequest(properties) { + function UndeployModelOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -979,115 +1001,63 @@ } /** - * ListDatasetsRequest parent. - * @member {string} parent - * @memberof google.cloud.automl.v1.ListDatasetsRequest - * @instance - */ - ListDatasetsRequest.prototype.parent = ""; - - /** - * ListDatasetsRequest filter. - * @member {string} filter - * @memberof google.cloud.automl.v1.ListDatasetsRequest - * @instance - */ - ListDatasetsRequest.prototype.filter = ""; - - /** - * ListDatasetsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.automl.v1.ListDatasetsRequest - * @instance - */ - ListDatasetsRequest.prototype.pageSize = 0; - - /** - * ListDatasetsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.automl.v1.ListDatasetsRequest - * @instance - */ - ListDatasetsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListDatasetsRequest instance using the specified properties. + * Creates a new UndeployModelOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest instance + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata instance */ - ListDatasetsRequest.create = function create(properties) { - return new ListDatasetsRequest(properties); + UndeployModelOperationMetadata.create = function create(properties) { + return new UndeployModelOperationMetadata(properties); }; /** - * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatasetsRequest.encode = function encode(message, writer) { + UndeployModelOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); return writer; }; /** - * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UndeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDatasetsRequest.decode = function decode(reader, length) { + UndeployModelOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 3: - message.filter = reader.string(); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 6: - message.pageToken = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1097,134 +1067,93 @@ }; /** - * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + UndeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDatasetsRequest message. + * Verifies an UndeployModelOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDatasetsRequest.verify = function verify(message) { + UndeployModelOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: 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 ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata */ - ListDatasetsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListDatasetsRequest) + UndeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; + return new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); }; /** - * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @static - * @param {google.cloud.automl.v1.ListDatasetsRequest} message ListDatasetsRequest + * @param {google.cloud.automl.v1.UndeployModelOperationMetadata} message UndeployModelOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatasetsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; + UndeployModelOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this ListDatasetsRequest to JSON. + * Converts this UndeployModelOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata * @instance * @returns {Object.} JSON object */ - ListDatasetsRequest.prototype.toJSON = function toJSON() { + UndeployModelOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListDatasetsRequest; + return UndeployModelOperationMetadata; })(); - v1.ListDatasetsResponse = (function() { + v1.CreateDatasetOperationMetadata = (function() { /** - * Properties of a ListDatasetsResponse. + * Properties of a CreateDatasetOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IListDatasetsResponse - * @property {Array.|null} [datasets] ListDatasetsResponse datasets - * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + * @interface ICreateDatasetOperationMetadata */ /** - * Constructs a new ListDatasetsResponse. + * Constructs a new CreateDatasetOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListDatasetsResponse. - * @implements IListDatasetsResponse + * @classdesc Represents a CreateDatasetOperationMetadata. + * @implements ICreateDatasetOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set */ - function ListDatasetsResponse(properties) { - this.datasets = []; + function CreateDatasetOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1232,92 +1161,63 @@ } /** - * ListDatasetsResponse datasets. - * @member {Array.} datasets - * @memberof google.cloud.automl.v1.ListDatasetsResponse - * @instance - */ - ListDatasetsResponse.prototype.datasets = $util.emptyArray; - - /** - * ListDatasetsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.automl.v1.ListDatasetsResponse - * @instance - */ - ListDatasetsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListDatasetsResponse instance using the specified properties. + * Creates a new CreateDatasetOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse instance + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata instance */ - ListDatasetsResponse.create = function create(properties) { - return new ListDatasetsResponse(properties); + CreateDatasetOperationMetadata.create = function create(properties) { + return new CreateDatasetOperationMetadata(properties); }; /** - * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatasetsResponse.encode = function encode(message, writer) { + CreateDatasetOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.datasets != null && message.datasets.length) - for (var i = 0; i < message.datasets.length; ++i) - $root.google.cloud.automl.v1.Dataset.encode(message.datasets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static - * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDatasetsResponse.decode = function decode(reader, length) { + CreateDatasetOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.datasets && message.datasets.length)) - message.datasets = []; - message.datasets.push($root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1327,134 +1227,93 @@ }; /** - * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDatasetsResponse message. + * Verifies a CreateDatasetOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDatasetsResponse.verify = function verify(message) { + CreateDatasetOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.datasets != null && message.hasOwnProperty("datasets")) { - if (!Array.isArray(message.datasets)) - return "datasets: array expected"; - for (var i = 0; i < message.datasets.length; ++i) { - var error = $root.google.cloud.automl.v1.Dataset.verify(message.datasets[i]); - if (error) - return "datasets." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata */ - ListDatasetsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListDatasetsResponse) + CreateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); - if (object.datasets) { - if (!Array.isArray(object.datasets)) - throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: array expected"); - message.datasets = []; - for (var i = 0; i < object.datasets.length; ++i) { - if (typeof object.datasets[i] !== "object") - throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: object expected"); - message.datasets[i] = $root.google.cloud.automl.v1.Dataset.fromObject(object.datasets[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; + return new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); }; /** - * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @static - * @param {google.cloud.automl.v1.ListDatasetsResponse} message ListDatasetsResponse + * @param {google.cloud.automl.v1.CreateDatasetOperationMetadata} message CreateDatasetOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatasetsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.datasets = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.datasets && message.datasets.length) { - object.datasets = []; - for (var j = 0; j < message.datasets.length; ++j) - object.datasets[j] = $root.google.cloud.automl.v1.Dataset.toObject(message.datasets[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; + CreateDatasetOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this ListDatasetsResponse to JSON. + * Converts this CreateDatasetOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata * @instance * @returns {Object.} JSON object */ - ListDatasetsResponse.prototype.toJSON = function toJSON() { + CreateDatasetOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListDatasetsResponse; + return CreateDatasetOperationMetadata; })(); - v1.UpdateDatasetRequest = (function() { + v1.CreateModelOperationMetadata = (function() { /** - * Properties of an UpdateDatasetRequest. + * Properties of a CreateModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IUpdateDatasetRequest - * @property {google.cloud.automl.v1.IDataset|null} [dataset] UpdateDatasetRequest dataset - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + * @interface ICreateModelOperationMetadata */ /** - * Constructs a new UpdateDatasetRequest. + * Constructs a new CreateModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents an UpdateDatasetRequest. - * @implements IUpdateDatasetRequest + * @classdesc Represents a CreateModelOperationMetadata. + * @implements ICreateModelOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set */ - function UpdateDatasetRequest(properties) { + function CreateModelOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1462,89 +1321,63 @@ } /** - * UpdateDatasetRequest dataset. - * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset - * @memberof google.cloud.automl.v1.UpdateDatasetRequest - * @instance - */ - UpdateDatasetRequest.prototype.dataset = null; - - /** - * UpdateDatasetRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.automl.v1.UpdateDatasetRequest - * @instance - */ - UpdateDatasetRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDatasetRequest instance using the specified properties. + * Creates a new CreateModelOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest instance + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata instance */ - UpdateDatasetRequest.create = function create(properties) { - return new UpdateDatasetRequest(properties); + CreateModelOperationMetadata.create = function create(properties) { + return new CreateModelOperationMetadata(properties); }; /** - * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatasetRequest.encode = function encode(message, writer) { + CreateModelOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataset != null && message.hasOwnProperty("dataset")) - $root.google.cloud.automl.v1.Dataset.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDatasetRequest.decode = function decode(reader, length) { + CreateModelOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.dataset = $root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -1554,126 +1387,93 @@ }; /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateDatasetRequest message. + * Verifies a CreateModelOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateDatasetRequest.verify = function verify(message) { + CreateModelOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) { - var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); - if (error) - return "dataset." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } return null; }; /** - * Creates an UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata */ - UpdateDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.UpdateDatasetRequest) + CreateModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); - if (object.dataset != null) { - if (typeof object.dataset !== "object") - throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.dataset: object expected"); - message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; + return new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); }; /** - * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @static - * @param {google.cloud.automl.v1.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {google.cloud.automl.v1.CreateModelOperationMetadata} message CreateModelOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = null; - object.updateMask = null; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; + CreateModelOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this UpdateDatasetRequest to JSON. + * Converts this CreateModelOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata * @instance * @returns {Object.} JSON object */ - UpdateDatasetRequest.prototype.toJSON = function toJSON() { + CreateModelOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateDatasetRequest; + return CreateModelOperationMetadata; })(); - v1.DeleteDatasetRequest = (function() { + v1.ImportDataOperationMetadata = (function() { /** - * Properties of a DeleteDatasetRequest. + * Properties of an ImportDataOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IDeleteDatasetRequest - * @property {string|null} [name] DeleteDatasetRequest name + * @interface IImportDataOperationMetadata */ /** - * Constructs a new DeleteDatasetRequest. + * Constructs a new ImportDataOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a DeleteDatasetRequest. - * @implements IDeleteDatasetRequest + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set */ - function DeleteDatasetRequest(properties) { + function ImportDataOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1681,76 +1481,63 @@ } /** - * DeleteDatasetRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.DeleteDatasetRequest - * @instance - */ - DeleteDatasetRequest.prototype.name = ""; - - /** - * Creates a new DeleteDatasetRequest instance using the specified properties. + * Creates a new ImportDataOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest instance + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata instance */ - DeleteDatasetRequest.create = function create(properties) { - return new DeleteDatasetRequest(properties); + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); }; /** - * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteDatasetRequest.encode = function encode(message, writer) { + ImportDataOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteDatasetRequest.decode = function decode(reader, length) { + ImportDataOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImportDataOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1760,108 +1547,94 @@ }; /** - * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + ImportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteDatasetRequest message. + * Verifies an ImportDataOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteDatasetRequest.verify = function verify(message) { + ImportDataOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata */ - DeleteDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.DeleteDatasetRequest) + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.automl.v1.ImportDataOperationMetadata(); }; /** - * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {google.cloud.automl.v1.ImportDataOperationMetadata} message ImportDataOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteDatasetRequest.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; + ImportDataOperationMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this DeleteDatasetRequest to JSON. + * Converts this ImportDataOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata * @instance * @returns {Object.} JSON object */ - DeleteDatasetRequest.prototype.toJSON = function toJSON() { + ImportDataOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteDatasetRequest; + return ImportDataOperationMetadata; })(); - v1.ImportDataRequest = (function() { + v1.ExportDataOperationMetadata = (function() { /** - * Properties of an ImportDataRequest. + * Properties of an ExportDataOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IImportDataRequest - * @property {string|null} [name] ImportDataRequest name - * @property {google.cloud.automl.v1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + * @interface IExportDataOperationMetadata + * @property {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null} [outputInfo] ExportDataOperationMetadata outputInfo */ /** - * Constructs a new ImportDataRequest. + * Constructs a new ExportDataOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents an ImportDataRequest. - * @implements IImportDataRequest + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set */ - function ImportDataRequest(properties) { + function ExportDataOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1869,88 +1642,75 @@ } /** - * ImportDataRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.ImportDataRequest - * @instance - */ - ImportDataRequest.prototype.name = ""; - - /** - * ImportDataRequest inputConfig. - * @member {google.cloud.automl.v1.IInputConfig|null|undefined} inputConfig - * @memberof google.cloud.automl.v1.ImportDataRequest + * ExportDataOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @instance */ - ImportDataRequest.prototype.inputConfig = null; + ExportDataOperationMetadata.prototype.outputInfo = null; /** - * Creates a new ImportDataRequest instance using the specified properties. + * Creates a new ExportDataOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest instance + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata instance */ - ImportDataRequest.create = function create(properties) { - return new ImportDataRequest(properties); + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); }; /** - * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {google.cloud.automl.v1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDataRequest.encode = function encode(message, writer) { + ExportDataOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - $root.google.cloud.automl.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.encode(message.outputInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {google.cloud.automl.v1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportDataRequest message from the specified reader or buffer. + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDataRequest.decode = function decode(reader, length) { + ExportDataOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImportDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 3: - message.inputConfig = $root.google.cloud.automl.v1.InputConfig.decode(reader, reader.uint32()); + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1961,122 +1721,318 @@ }; /** - * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { + ExportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportDataRequest message. + * Verifies an ExportDataOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportDataRequest.verify = function verify(message) { + ExportDataOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { - var error = $root.google.cloud.automl.v1.InputConfig.verify(message.inputConfig); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify(message.outputInfo); if (error) - return "inputConfig." + error; + return "outputInfo." + error; } return null; }; /** - * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata */ - ImportDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ImportDataRequest) + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.ImportDataRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.inputConfig != null) { - if (typeof object.inputConfig !== "object") - throw TypeError(".google.cloud.automl.v1.ImportDataRequest.inputConfig: object expected"); - message.inputConfig = $root.google.cloud.automl.v1.InputConfig.fromObject(object.inputConfig); + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.fromObject(object.outputInfo); } return message; }; /** - * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @static - * @param {google.cloud.automl.v1.ImportDataRequest} message ImportDataRequest + * @param {google.cloud.automl.v1.ExportDataOperationMetadata} message ExportDataOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDataRequest.toObject = function toObject(message, options) { + ExportDataOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.inputConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) - object.inputConfig = $root.google.cloud.automl.v1.InputConfig.toObject(message.inputConfig, options); + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.toObject(message.outputInfo, options); return object; }; /** - * Converts this ImportDataRequest to JSON. + * Converts this ExportDataOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ImportDataRequest + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata * @instance * @returns {Object.} JSON object */ - ImportDataRequest.prototype.toJSON = function toJSON() { + ExportDataOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportDataRequest; + ExportDataOperationMetadata.ExportDataOutputInfo = (function() { + + /** + * Properties of an ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @interface IExportDataOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportDataOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @classdesc Represents an ExportDataOutputInfo. + * @implements IExportDataOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + */ + function ExportDataOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.gcsOutputDirectory = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + Object.defineProperty(ExportDataOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo instance + */ + ExportDataOutputInfo.create = function create(properties) { + return new ExportDataOutputInfo(properties); + }; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsOutputDirectory = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates an ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + */ + ExportDataOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} message ExportDataOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportDataOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportDataOutputInfo; + })(); + + return ExportDataOperationMetadata; })(); - v1.ExportDataRequest = (function() { + v1.BatchPredictOperationMetadata = (function() { /** - * Properties of an ExportDataRequest. + * Properties of a BatchPredictOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IExportDataRequest - * @property {string|null} [name] ExportDataRequest name - * @property {google.cloud.automl.v1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + * @interface IBatchPredictOperationMetadata + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictOperationMetadata inputConfig + * @property {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null} [outputInfo] BatchPredictOperationMetadata outputInfo */ /** - * Constructs a new ExportDataRequest. + * Constructs a new BatchPredictOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents an ExportDataRequest. - * @implements IExportDataRequest + * @classdesc Represents a BatchPredictOperationMetadata. + * @implements IBatchPredictOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set */ - function ExportDataRequest(properties) { + function BatchPredictOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2084,88 +2040,88 @@ } /** - * ExportDataRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.ExportDataRequest + * BatchPredictOperationMetadata inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @instance */ - ExportDataRequest.prototype.name = ""; + BatchPredictOperationMetadata.prototype.inputConfig = null; /** - * ExportDataRequest outputConfig. - * @member {google.cloud.automl.v1.IOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.automl.v1.ExportDataRequest + * BatchPredictOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @instance */ - ExportDataRequest.prototype.outputConfig = null; + BatchPredictOperationMetadata.prototype.outputInfo = null; /** - * Creates a new ExportDataRequest instance using the specified properties. + * Creates a new BatchPredictOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static - * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest instance + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata instance */ - ExportDataRequest.create = function create(properties) { - return new ExportDataRequest(properties); + BatchPredictOperationMetadata.create = function create(properties) { + return new BatchPredictOperationMetadata(properties); }; /** - * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static - * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportDataRequest.encode = function encode(message, writer) { + BatchPredictOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - $root.google.cloud.automl.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static - * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchPredictOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportDataRequest message from the specified reader or buffer. + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportDataRequest.decode = function decode(reader, length) { + BatchPredictOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); break; - case 3: - message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.decode(reader, reader.uint32()); + case 2: + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2176,336 +2132,331 @@ }; /** - * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { + BatchPredictOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportDataRequest message. + * Verifies a BatchPredictOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportDataRequest.verify = function verify(message) { + BatchPredictOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.automl.v1.OutputConfig.verify(message.outputConfig); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); if (error) - return "outputConfig." + error; + return "inputConfig." + error; + } + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; } return null; }; /** - * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata */ - ExportDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ExportDataRequest) + BatchPredictOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.ExportDataRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.automl.v1.ExportDataRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.fromObject(object.outputConfig); + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.fromObject(object.outputInfo); } return message; }; /** - * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @static - * @param {google.cloud.automl.v1.ExportDataRequest} message ExportDataRequest + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata} message BatchPredictOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportDataRequest.toObject = function toObject(message, options) { + BatchPredictOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.outputConfig = null; + object.inputConfig = null; + object.outputInfo = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.automl.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.toObject(message.outputInfo, options); return object; }; /** - * Converts this ExportDataRequest to JSON. + * Converts this BatchPredictOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ExportDataRequest + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata * @instance * @returns {Object.} JSON object */ - ExportDataRequest.prototype.toJSON = function toJSON() { + BatchPredictOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportDataRequest; - })(); + BatchPredictOperationMetadata.BatchPredictOutputInfo = (function() { - v1.CreateModelRequest = (function() { + /** + * Properties of a BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @interface IBatchPredictOutputInfo + * @property {string|null} [gcsOutputDirectory] BatchPredictOutputInfo gcsOutputDirectory + */ - /** - * Properties of a CreateModelRequest. - * @memberof google.cloud.automl.v1 - * @interface ICreateModelRequest - * @property {string|null} [parent] CreateModelRequest parent - * @property {google.cloud.automl.v1.IModel|null} [model] CreateModelRequest model - */ + /** + * Constructs a new BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @classdesc Represents a BatchPredictOutputInfo. + * @implements IBatchPredictOutputInfo + * @constructor + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + */ + function BatchPredictOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new CreateModelRequest. - * @memberof google.cloud.automl.v1 - * @classdesc Represents a CreateModelRequest. - * @implements ICreateModelRequest - * @constructor - * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set - */ - function CreateModelRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * BatchPredictOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.gcsOutputDirectory = ""; - /** - * CreateModelRequest parent. - * @member {string} parent - * @memberof google.cloud.automl.v1.CreateModelRequest - * @instance - */ - CreateModelRequest.prototype.parent = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * CreateModelRequest model. - * @member {google.cloud.automl.v1.IModel|null|undefined} model - * @memberof google.cloud.automl.v1.CreateModelRequest - * @instance - */ - CreateModelRequest.prototype.model = null; + /** + * BatchPredictOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + Object.defineProperty(BatchPredictOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new CreateModelRequest instance using the specified properties. - * @function create - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest instance - */ - CreateModelRequest.create = function create(properties) { - return new CreateModelRequest(properties); - }; + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo instance + */ + BatchPredictOutputInfo.create = function create(properties) { + return new BatchPredictOutputInfo(properties); + }; - /** - * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateModelRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.model != null && message.hasOwnProperty("model")) - $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; - /** - * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a CreateModelRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateModelRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 4: - message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsOutputDirectory = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a CreateModelRequest message. - * @function verify - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateModelRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.model != null && message.hasOwnProperty("model")) { - var error = $root.google.cloud.automl.v1.Model.verify(message.model); - if (error) - return "model." + error; - } - return null; - }; + /** + * Verifies a BatchPredictOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; - /** - * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest - */ - CreateModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.CreateModelRequest) + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + */ + BatchPredictOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} message BatchPredictOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } return object; - var message = new $root.google.cloud.automl.v1.CreateModelRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.model != null) { - if (typeof object.model !== "object") - throw TypeError(".google.cloud.automl.v1.CreateModelRequest.model: object expected"); - message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); - } - return message; - }; + }; - /** - * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.automl.v1.CreateModelRequest - * @static - * @param {google.cloud.automl.v1.CreateModelRequest} message CreateModelRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateModelRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.model = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.model != null && message.hasOwnProperty("model")) - object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); - return object; - }; + /** + * Converts this BatchPredictOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this CreateModelRequest to JSON. - * @function toJSON - * @memberof google.cloud.automl.v1.CreateModelRequest - * @instance - * @returns {Object.} JSON object - */ - CreateModelRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return BatchPredictOutputInfo; + })(); - return CreateModelRequest; + return BatchPredictOperationMetadata; })(); - v1.GetModelRequest = (function() { + v1.ExportModelOperationMetadata = (function() { /** - * Properties of a GetModelRequest. + * Properties of an ExportModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @interface IGetModelRequest - * @property {string|null} [name] GetModelRequest name + * @interface IExportModelOperationMetadata + * @property {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null} [outputInfo] ExportModelOperationMetadata outputInfo */ /** - * Constructs a new GetModelRequest. + * Constructs a new ExportModelOperationMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a GetModelRequest. - * @implements IGetModelRequest + * @classdesc Represents an ExportModelOperationMetadata. + * @implements IExportModelOperationMetadata * @constructor - * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set */ - function GetModelRequest(properties) { + function ExportModelOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2513,75 +2464,75 @@ } /** - * GetModelRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.GetModelRequest + * ExportModelOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @instance */ - GetModelRequest.prototype.name = ""; + ExportModelOperationMetadata.prototype.outputInfo = null; /** - * Creates a new GetModelRequest instance using the specified properties. + * Creates a new ExportModelOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest instance + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata instance */ - GetModelRequest.create = function create(properties) { - return new GetModelRequest(properties); + ExportModelOperationMetadata.create = function create(properties) { + return new ExportModelOperationMetadata(properties); }; /** - * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetModelRequest.encode = function encode(message, writer) { + ExportModelOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static - * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetModelRequest message from the specified reader or buffer. + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetModelRequest.decode = function decode(reader, length) { + ExportModelOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); + case 2: + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2592,110 +2543,312 @@ }; /** - * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + ExportModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetModelRequest message. + * Verifies an ExportModelOperationMetadata message. * @function verify - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetModelRequest.verify = function verify(message) { + ExportModelOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } return null; }; /** - * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata */ - GetModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.GetModelRequest) + ExportModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata) return object; - var message = new $root.google.cloud.automl.v1.GetModelRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.fromObject(object.outputInfo); + } return message; }; /** - * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @static - * @param {google.cloud.automl.v1.GetModelRequest} message GetModelRequest + * @param {google.cloud.automl.v1.ExportModelOperationMetadata} message ExportModelOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetModelRequest.toObject = function toObject(message, options) { + ExportModelOperationMetadata.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; + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.toObject(message.outputInfo, options); return object; }; /** - * Converts this GetModelRequest to JSON. + * Converts this ExportModelOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.GetModelRequest + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata * @instance * @returns {Object.} JSON object */ - GetModelRequest.prototype.toJSON = function toJSON() { + ExportModelOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetModelRequest; - })(); - - v1.ListModelsRequest = (function() { + ExportModelOperationMetadata.ExportModelOutputInfo = (function() { - /** - * Properties of a ListModelsRequest. - * @memberof google.cloud.automl.v1 - * @interface IListModelsRequest - * @property {string|null} [parent] ListModelsRequest parent - * @property {string|null} [filter] ListModelsRequest filter - * @property {number|null} [pageSize] ListModelsRequest pageSize - * @property {string|null} [pageToken] ListModelsRequest pageToken - */ + /** + * Properties of an ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @interface IExportModelOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportModelOutputInfo gcsOutputDirectory + */ - /** - * Constructs a new ListModelsRequest. + /** + * Constructs a new ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @classdesc Represents an ExportModelOutputInfo. + * @implements IExportModelOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + */ + function ExportModelOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + */ + ExportModelOutputInfo.prototype.gcsOutputDirectory = ""; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo instance + */ + ExportModelOutputInfo.create = function create(properties) { + return new ExportModelOutputInfo(properties); + }; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsOutputDirectory = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + return null; + }; + + /** + * Creates an ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + */ + ExportModelOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} message ExportModelOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsOutputDirectory = ""; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + object.gcsOutputDirectory = message.gcsOutputDirectory; + return object; + }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportModelOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportModelOutputInfo; + })(); + + return ExportModelOperationMetadata; + })(); + + v1.Dataset = (function() { + + /** + * Properties of a Dataset. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListModelsRequest. - * @implements IListModelsRequest + * @interface IDataset + * @property {google.cloud.automl.v1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata + * @property {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null} [imageClassificationDatasetMetadata] Dataset imageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null} [textClassificationDatasetMetadata] Dataset textClassificationDatasetMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null} [imageObjectDetectionDatasetMetadata] Dataset imageObjectDetectionDatasetMetadata + * @property {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null} [textExtractionDatasetMetadata] Dataset textExtractionDatasetMetadata + * @property {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null} [textSentimentDatasetMetadata] Dataset textSentimentDatasetMetadata + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {number|null} [exampleCount] Dataset exampleCount + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {string|null} [etag] Dataset etag + * @property {Object.|null} [labels] Dataset labels + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Dataset. + * @implements IDataset * @constructor - * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set */ - function ListModelsRequest(properties) { + function Dataset(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2703,114 +2856,251 @@ } /** - * ListModelsRequest parent. - * @member {string} parent - * @memberof google.cloud.automl.v1.ListModelsRequest + * Dataset translationDatasetMetadata. + * @member {google.cloud.automl.v1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset * @instance */ - ListModelsRequest.prototype.parent = ""; + Dataset.prototype.translationDatasetMetadata = null; /** - * ListModelsRequest filter. - * @member {string} filter - * @memberof google.cloud.automl.v1.ListModelsRequest + * Dataset imageClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null|undefined} imageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset * @instance */ - ListModelsRequest.prototype.filter = ""; + Dataset.prototype.imageClassificationDatasetMetadata = null; /** - * ListModelsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.automl.v1.ListModelsRequest + * Dataset textClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null|undefined} textClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset * @instance */ - ListModelsRequest.prototype.pageSize = 0; + Dataset.prototype.textClassificationDatasetMetadata = null; /** - * ListModelsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.automl.v1.ListModelsRequest + * Dataset imageObjectDetectionDatasetMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null|undefined} imageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset * @instance */ - ListModelsRequest.prototype.pageToken = ""; + Dataset.prototype.imageObjectDetectionDatasetMetadata = null; /** - * Creates a new ListModelsRequest instance using the specified properties. + * Dataset textExtractionDatasetMetadata. + * @member {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null|undefined} textExtractionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textExtractionDatasetMetadata = null; + + /** + * Dataset textSentimentDatasetMetadata. + * @member {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null|undefined} textSentimentDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textSentimentDatasetMetadata = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.exampleCount = 0; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + /** + * Dataset labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset datasetMetadata. + * @member {"translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|undefined} datasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "datasetMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata", "imageClassificationDatasetMetadata", "textClassificationDatasetMetadata", "imageObjectDetectionDatasetMetadata", "textExtractionDatasetMetadata", "textSentimentDatasetMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static - * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest instance + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Dataset} Dataset instance */ - ListModelsRequest.create = function create(properties) { - return new ListModelsRequest(properties); + Dataset.create = function create(properties) { + return new Dataset(properties); }; /** - * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static - * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsRequest.encode = function encode(message, writer) { + Dataset.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && message.hasOwnProperty("description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) + $root.google.cloud.automl.v1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.encode(message.imageClassificationDatasetMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.encode(message.textClassificationDatasetMetadata, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.encode(message.imageObjectDetectionDatasetMetadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) + $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.encode(message.textExtractionDatasetMetadata, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) + $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.encode(message.textSentimentDatasetMetadata, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 39, wireType 2 =*/314).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static - * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Dataset.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelsRequest message from the specified reader or buffer. + * Decodes a Dataset message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.automl.v1.Dataset} Dataset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelsRequest.decode = function decode(reader, length) { + Dataset.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Dataset(), key; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 23: + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.decode(reader, reader.uint32()); + break; + case 24: + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + case 25: + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + case 26: + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.decode(reader, reader.uint32()); + break; + case 28: + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.decode(reader, reader.uint32()); + break; + case 30: + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.decode(reader, reader.uint32()); + break; case 1: - message.parent = reader.string(); + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); break; case 3: - message.filter = reader.string(); + message.description = reader.string(); break; - case 4: - message.pageSize = reader.int32(); + case 21: + message.exampleCount = reader.int32(); break; - case 6: - message.pageToken = reader.string(); + case 14: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 17: + message.etag = reader.string(); + break; + case 39: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); break; default: reader.skipType(tag & 7); @@ -2821,134 +3111,295 @@ }; /** - * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * Decodes a Dataset message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.automl.v1.Dataset} Dataset * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + Dataset.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelsRequest message. + * Verifies a Dataset message. * @function verify - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListModelsRequest.verify = function verify(message) { + Dataset.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: 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"; + var properties = {}; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (error) + return "translationDatasetMetadata." + error; + } + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify(message.imageClassificationDatasetMetadata); + if (error) + return "imageClassificationDatasetMetadata." + error; + } + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.verify(message.textClassificationDatasetMetadata); + if (error) + return "textClassificationDatasetMetadata." + error; + } + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify(message.imageObjectDetectionDatasetMetadata); + if (error) + return "imageObjectDetectionDatasetMetadata." + error; + } + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.verify(message.textExtractionDatasetMetadata); + if (error) + return "textExtractionDatasetMetadata." + error; + } + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.verify(message.textSentimentDatasetMetadata); + if (error) + return "textSentimentDatasetMetadata." + error; + } + } + 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + 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"; + } return null; }; /** - * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @returns {google.cloud.automl.v1.Dataset} Dataset */ - ListModelsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListModelsRequest) + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Dataset) return object; - var message = new $root.google.cloud.automl.v1.ListModelsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.automl.v1.Dataset(); + if (object.translationDatasetMetadata != null) { + if (typeof object.translationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.translationDatasetMetadata: object expected"); + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); + } + if (object.imageClassificationDatasetMetadata != null) { + if (typeof object.imageClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageClassificationDatasetMetadata: object expected"); + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.fromObject(object.imageClassificationDatasetMetadata); + } + if (object.textClassificationDatasetMetadata != null) { + if (typeof object.textClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textClassificationDatasetMetadata: object expected"); + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.fromObject(object.textClassificationDatasetMetadata); + } + if (object.imageObjectDetectionDatasetMetadata != null) { + if (typeof object.imageObjectDetectionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageObjectDetectionDatasetMetadata: object expected"); + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.fromObject(object.imageObjectDetectionDatasetMetadata); + } + if (object.textExtractionDatasetMetadata != null) { + if (typeof object.textExtractionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textExtractionDatasetMetadata: object expected"); + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.fromObject(object.textExtractionDatasetMetadata); + } + if (object.textSentimentDatasetMetadata != null) { + if (typeof object.textSentimentDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textSentimentDatasetMetadata: object expected"); + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.fromObject(object.textSentimentDatasetMetadata); + } + 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.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } return message; }; /** - * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Dataset message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @static - * @param {google.cloud.automl.v1.ListModelsRequest} message ListModelsRequest + * @param {google.cloud.automl.v1.Dataset} message Dataset * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelsRequest.toObject = function toObject(message, options) { + Dataset.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.etag = ""; + object.exampleCount = 0; + } + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + object.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "translationDatasetMetadata"; + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + object.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.toObject(message.imageClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageClassificationDatasetMetadata"; + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + object.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.toObject(message.textClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textClassificationDatasetMetadata"; + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + object.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.toObject(message.imageObjectDetectionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageObjectDetectionDatasetMetadata"; + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + object.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.toObject(message.textExtractionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textExtractionDatasetMetadata"; + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + object.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.toObject(message.textSentimentDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textSentimentDatasetMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - 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 ListModelsRequest to JSON. + * Converts this Dataset to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ListModelsRequest + * @memberof google.cloud.automl.v1.Dataset * @instance * @returns {Object.} JSON object */ - ListModelsRequest.prototype.toJSON = function toJSON() { + Dataset.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListModelsRequest; + return Dataset; })(); - v1.ListModelsResponse = (function() { + v1.ImageClassificationDatasetMetadata = (function() { /** - * Properties of a ListModelsResponse. + * Properties of an ImageClassificationDatasetMetadata. * @memberof google.cloud.automl.v1 - * @interface IListModelsResponse - * @property {Array.|null} [model] ListModelsResponse model - * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + * @interface IImageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] ImageClassificationDatasetMetadata classificationType */ /** - * Constructs a new ListModelsResponse. + * Constructs a new ImageClassificationDatasetMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListModelsResponse. - * @implements IListModelsResponse + * @classdesc Represents an ImageClassificationDatasetMetadata. + * @implements IImageClassificationDatasetMetadata * @constructor - * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set */ - function ListModelsResponse(properties) { - this.model = []; + function ImageClassificationDatasetMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2956,91 +3407,75 @@ } /** - * ListModelsResponse model. - * @member {Array.} model - * @memberof google.cloud.automl.v1.ListModelsResponse - * @instance - */ - ListModelsResponse.prototype.model = $util.emptyArray; - - /** - * ListModelsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.automl.v1.ListModelsResponse + * ImageClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @instance */ - ListModelsResponse.prototype.nextPageToken = ""; + ImageClassificationDatasetMetadata.prototype.classificationType = 0; /** - * Creates a new ListModelsResponse instance using the specified properties. + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static - * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse instance + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata instance */ - ListModelsResponse.create = function create(properties) { - return new ListModelsResponse(properties); + ImageClassificationDatasetMetadata.create = function create(properties) { + return new ImageClassificationDatasetMetadata(properties); }; /** - * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static - * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsResponse.encode = function encode(message, writer) { + ImageClassificationDatasetMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.model != null && message.model.length) - for (var i = 0; i < message.model.length; ++i) - $root.google.cloud.automl.v1.Model.encode(message.model[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); return writer; }; /** - * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static - * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImageClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelsResponse message from the specified reader or buffer. + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelsResponse.decode = function decode(reader, length) { + ImageClassificationDatasetMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.model && message.model.length)) - message.model = []; - message.model.push($root.google.cloud.automl.v1.Model.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + message.classificationType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3051,133 +3486,124 @@ }; /** - * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + ImageClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelsResponse message. + * Verifies an ImageClassificationDatasetMetadata message. * @function verify - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListModelsResponse.verify = function verify(message) { + ImageClassificationDatasetMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.model != null && message.hasOwnProperty("model")) { - if (!Array.isArray(message.model)) - return "model: array expected"; - for (var i = 0; i < message.model.length; ++i) { - var error = $root.google.cloud.automl.v1.Model.verify(message.model[i]); - if (error) - return "model." + error; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata */ - ListModelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListModelsResponse) + ImageClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata) return object; - var message = new $root.google.cloud.automl.v1.ListModelsResponse(); - if (object.model) { - if (!Array.isArray(object.model)) - throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: array expected"); - message.model = []; - for (var i = 0; i < object.model.length; ++i) { - if (typeof object.model[i] !== "object") - throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: object expected"); - message.model[i] = $root.google.cloud.automl.v1.Model.fromObject(object.model[i]); - } + var message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + switch (object.classificationType) { + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @static - * @param {google.cloud.automl.v1.ListModelsResponse} message ListModelsResponse + * @param {google.cloud.automl.v1.ImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelsResponse.toObject = function toObject(message, options) { + ImageClassificationDatasetMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.model = []; if (options.defaults) - object.nextPageToken = ""; - if (message.model && message.model.length) { - object.model = []; - for (var j = 0; j < message.model.length; ++j) - object.model[j] = $root.google.cloud.automl.v1.Model.toObject(message.model[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; return object; }; /** - * Converts this ListModelsResponse to JSON. + * Converts this ImageClassificationDatasetMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ListModelsResponse + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata * @instance * @returns {Object.} JSON object */ - ListModelsResponse.prototype.toJSON = function toJSON() { + ImageClassificationDatasetMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListModelsResponse; + return ImageClassificationDatasetMetadata; })(); - v1.DeleteModelRequest = (function() { + v1.ImageObjectDetectionDatasetMetadata = (function() { /** - * Properties of a DeleteModelRequest. + * Properties of an ImageObjectDetectionDatasetMetadata. * @memberof google.cloud.automl.v1 - * @interface IDeleteModelRequest - * @property {string|null} [name] DeleteModelRequest name + * @interface IImageObjectDetectionDatasetMetadata */ /** - * Constructs a new DeleteModelRequest. + * Constructs a new ImageObjectDetectionDatasetMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a DeleteModelRequest. - * @implements IDeleteModelRequest + * @classdesc Represents an ImageObjectDetectionDatasetMetadata. + * @implements IImageObjectDetectionDatasetMetadata * @constructor - * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set */ - function DeleteModelRequest(properties) { + function ImageObjectDetectionDatasetMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3185,76 +3611,63 @@ } /** - * DeleteModelRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.DeleteModelRequest - * @instance - */ - DeleteModelRequest.prototype.name = ""; - - /** - * Creates a new DeleteModelRequest instance using the specified properties. + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static - * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest instance + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata instance */ - DeleteModelRequest.create = function create(properties) { - return new DeleteModelRequest(properties); + ImageObjectDetectionDatasetMetadata.create = function create(properties) { + return new ImageObjectDetectionDatasetMetadata(properties); }; /** - * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static - * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encode = function encode(message, writer) { + ImageObjectDetectionDatasetMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static - * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImageObjectDetectionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer. + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelRequest.decode = function decode(reader, length) { + ImageObjectDetectionDatasetMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -3264,108 +3677,100 @@ }; /** - * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + ImageObjectDetectionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteModelRequest message. + * Verifies an ImageObjectDetectionDatasetMetadata message. * @function verify - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteModelRequest.verify = function verify(message) { + ImageObjectDetectionDatasetMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata */ - DeleteModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.DeleteModelRequest) + ImageObjectDetectionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) return object; - var message = new $root.google.cloud.automl.v1.DeleteModelRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); }; /** - * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @static - * @param {google.cloud.automl.v1.DeleteModelRequest} message DeleteModelRequest + * @param {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteModelRequest.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; + ImageObjectDetectionDatasetMetadata.toObject = function toObject() { + return {}; }; /** - * Converts this DeleteModelRequest to JSON. + * Converts this ImageObjectDetectionDatasetMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.DeleteModelRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata * @instance * @returns {Object.} JSON object */ - DeleteModelRequest.prototype.toJSON = function toJSON() { + ImageObjectDetectionDatasetMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteModelRequest; + return ImageObjectDetectionDatasetMetadata; })(); - v1.UpdateModelRequest = (function() { + v1.ImageClassificationModelMetadata = (function() { /** - * Properties of an UpdateModelRequest. + * Properties of an ImageClassificationModelMetadata. * @memberof google.cloud.automl.v1 - * @interface IUpdateModelRequest - * @property {google.cloud.automl.v1.IModel|null} [model] UpdateModelRequest model - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask + * @interface IImageClassificationModelMetadata + * @property {string|null} [baseModelId] ImageClassificationModelMetadata baseModelId + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageClassificationModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageClassificationModelMetadata trainCostMilliNodeHours + * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason + * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount */ /** - * Constructs a new UpdateModelRequest. + * Constructs a new ImageClassificationModelMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents an UpdateModelRequest. - * @implements IUpdateModelRequest + * @classdesc Represents an ImageClassificationModelMetadata. + * @implements IImageClassificationModelMetadata * @constructor - * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set */ - function UpdateModelRequest(properties) { + function ImageClassificationModelMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3373,218 +3778,360 @@ } /** - * UpdateModelRequest model. - * @member {google.cloud.automl.v1.IModel|null|undefined} model - * @memberof google.cloud.automl.v1.UpdateModelRequest + * ImageClassificationModelMetadata baseModelId. + * @member {string} baseModelId + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @instance */ - UpdateModelRequest.prototype.model = null; + ImageClassificationModelMetadata.prototype.baseModelId = ""; /** - * UpdateModelRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.automl.v1.UpdateModelRequest + * ImageClassificationModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @instance */ - UpdateModelRequest.prototype.updateMask = null; + ImageClassificationModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new UpdateModelRequest instance using the specified properties. + * ImageClassificationModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.stopReason = ""; + + /** + * ImageClassificationModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.modelType = ""; + + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static - * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest instance + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata instance */ - UpdateModelRequest.create = function create(properties) { - return new UpdateModelRequest(properties); + ImageClassificationModelMetadata.create = function create(properties) { + return new ImageClassificationModelMetadata(properties); }; /** - * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static - * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateModelRequest.encode = function encode(message, writer) { + ImageClassificationModelMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.model != null && message.hasOwnProperty("model")) - $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModelId); + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.modelType != null && message.hasOwnProperty("modelType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.trainCostMilliNodeHours); return writer; }; /** - * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static - * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImageClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateModelRequest message from the specified reader or buffer. + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateModelRequest.decode = function decode(reader, length) { + ImageClassificationModelMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); + message.baseModelId = reader.string(); break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + case 16: + message.trainBudgetMilliNodeHours = reader.int64(); break; - default: - reader.skipType(tag & 7); + case 17: + message.trainCostMilliNodeHours = reader.int64(); break; - } - } - return message; - }; - + case 5: + message.stopReason = reader.string(); + break; + case 7: + message.modelType = reader.string(); + break; + case 13: + message.nodeQps = reader.double(); + break; + case 14: + message.nodeCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** - * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateModelRequest.decodeDelimited = function decodeDelimited(reader) { + ImageClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateModelRequest message. + * Verifies an ImageClassificationModelMetadata message. * @function verify - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateModelRequest.verify = function verify(message) { + ImageClassificationModelMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.model != null && message.hasOwnProperty("model")) { - var error = $root.google.cloud.automl.v1.Model.verify(message.model); - if (error) - return "model." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; return null; }; /** - * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata */ - UpdateModelRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.UpdateModelRequest) + ImageClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelMetadata) return object; - var message = new $root.google.cloud.automl.v1.UpdateModelRequest(); - if (object.model != null) { - if (typeof object.model !== "object") - throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.model: object expected"); - message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @static - * @param {google.cloud.automl.v1.UpdateModelRequest} message UpdateModelRequest + * @param {google.cloud.automl.v1.ImageClassificationModelMetadata} message ImageClassificationModelMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateModelRequest.toObject = function toObject(message, options) { + ImageClassificationModelMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.model = null; - object.updateMask = null; + object.baseModelId = ""; + object.stopReason = ""; + object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; } - if (message.model != null && message.hasOwnProperty("model")) - object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; return object; }; /** - * Converts this UpdateModelRequest to JSON. + * Converts this ImageClassificationModelMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.UpdateModelRequest + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata * @instance * @returns {Object.} JSON object */ - UpdateModelRequest.prototype.toJSON = function toJSON() { + ImageClassificationModelMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateModelRequest; + return ImageClassificationModelMetadata; })(); - v1.GetModelEvaluationRequest = (function() { + v1.ImageObjectDetectionModelMetadata = (function() { /** - * Properties of a GetModelEvaluationRequest. + * Properties of an ImageObjectDetectionModelMetadata. * @memberof google.cloud.automl.v1 - * @interface IGetModelEvaluationRequest - * @property {string|null} [name] GetModelEvaluationRequest name + * @interface IImageObjectDetectionModelMetadata + * @property {string|null} [modelType] ImageObjectDetectionModelMetadata modelType + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelMetadata nodeCount + * @property {number|null} [nodeQps] ImageObjectDetectionModelMetadata nodeQps + * @property {string|null} [stopReason] ImageObjectDetectionModelMetadata stopReason + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ /** - * Constructs a new GetModelEvaluationRequest. + * Constructs a new ImageObjectDetectionModelMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a GetModelEvaluationRequest. - * @implements IGetModelEvaluationRequest + * @classdesc Represents an ImageObjectDetectionModelMetadata. + * @implements IImageObjectDetectionModelMetadata * @constructor - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set */ - function GetModelEvaluationRequest(properties) { + function ImageObjectDetectionModelMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3592,75 +4139,140 @@ } /** - * GetModelEvaluationRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * ImageObjectDetectionModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @instance */ - GetModelEvaluationRequest.prototype.name = ""; + ImageObjectDetectionModelMetadata.prototype.modelType = ""; /** - * Creates a new GetModelEvaluationRequest instance using the specified properties. + * ImageObjectDetectionModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeQps = 0; + + /** + * ImageObjectDetectionModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.stopReason = ""; + + /** + * ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest instance + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata instance */ - GetModelEvaluationRequest.create = function create(properties) { - return new GetModelEvaluationRequest(properties); + ImageObjectDetectionModelMetadata.create = function create(properties) { + return new ImageObjectDetectionModelMetadata(properties); }; /** - * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetModelEvaluationRequest.encode = function encode(message, writer) { + ImageObjectDetectionModelMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.modelType != null && message.hasOwnProperty("modelType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelType); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.nodeCount); + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.nodeQps); + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); return writer; }; /** - * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static - * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImageObjectDetectionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetModelEvaluationRequest.decode = function decode(reader, length) { + ImageObjectDetectionModelMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.modelType = reader.string(); + break; + case 3: + message.nodeCount = reader.int64(); + break; + case 4: + message.nodeQps = reader.double(); + break; + case 5: + message.stopReason = reader.string(); + break; + case 6: + message.trainBudgetMilliNodeHours = reader.int64(); + break; + case 7: + message.trainCostMilliNodeHours = reader.int64(); break; default: reader.skipType(tag & 7); @@ -3671,110 +4283,190 @@ }; /** - * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + ImageObjectDetectionModelMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetModelEvaluationRequest message. + * Verifies an ImageObjectDetectionModelMetadata message. * @function verify - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetModelEvaluationRequest.verify = function verify(message) { + ImageObjectDetectionModelMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; return null; }; /** - * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata */ - GetModelEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.GetModelEvaluationRequest) + ImageObjectDetectionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) return object; - var message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @static - * @param {google.cloud.automl.v1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetModelEvaluationRequest.toObject = function toObject(message, options) { + ImageObjectDetectionModelMetadata.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 (options.defaults) { + object.modelType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + object.nodeQps = 0; + object.stopReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; return object; }; /** - * Converts this GetModelEvaluationRequest to JSON. + * Converts this ImageObjectDetectionModelMetadata to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata * @instance * @returns {Object.} JSON object */ - GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + ImageObjectDetectionModelMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetModelEvaluationRequest; + return ImageObjectDetectionModelMetadata; })(); - v1.ListModelEvaluationsRequest = (function() { + v1.ImageClassificationModelDeploymentMetadata = (function() { /** - * Properties of a ListModelEvaluationsRequest. + * Properties of an ImageClassificationModelDeploymentMetadata. * @memberof google.cloud.automl.v1 - * @interface IListModelEvaluationsRequest - * @property {string|null} [parent] ListModelEvaluationsRequest parent - * @property {string|null} [filter] ListModelEvaluationsRequest filter - * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize - * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken + * @interface IImageClassificationModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageClassificationModelDeploymentMetadata nodeCount */ /** - * Constructs a new ListModelEvaluationsRequest. + * Constructs a new ImageClassificationModelDeploymentMetadata. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListModelEvaluationsRequest. - * @implements IListModelEvaluationsRequest + * @classdesc Represents an ImageClassificationModelDeploymentMetadata. + * @implements IImageClassificationModelDeploymentMetadata * @constructor - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set */ - function ListModelEvaluationsRequest(properties) { + function ImageClassificationModelDeploymentMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3782,252 +4474,13702 @@ } /** - * ListModelEvaluationsRequest parent. - * @member {string} parent - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * ImageClassificationModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata * @instance */ - ListModelEvaluationsRequest.prototype.parent = ""; + ImageClassificationModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata instance + */ + ImageClassificationModelDeploymentMetadata.create = function create(properties) { + return new ImageClassificationModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + */ + ImageClassificationModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageClassificationModelDeploymentMetadata; + })(); + + v1.ImageObjectDetectionModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionModelDeploymentMetadata. + * @implements IImageObjectDetectionModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata instance + */ + ImageObjectDetectionModelDeploymentMetadata.create = function create(properties) { + return new ImageObjectDetectionModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + */ + ImageObjectDetectionModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageObjectDetectionModelDeploymentMetadata; + })(); + + v1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationSpec + * @property {string|null} [name] AnnotationSpec name + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {number|null} [exampleCount] AnnotationSpec exampleCount + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.automl.v1.IAnnotationSpec=} [properties] Properties to set + */ + function AnnotationSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.name = ""; + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.exampleCount = 0; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.exampleCount); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 9: + message.exampleCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpec message. + * @function verify + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + return null; + }; + + /** + * Creates an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationSpec) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.AnnotationSpec} message AnnotationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.exampleCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + return object; + }; + + /** + * Converts this AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotationSpec; + })(); + + /** + * ClassificationType enum. + * @name google.cloud.automl.v1.ClassificationType + * @enum {string} + * @property {number} CLASSIFICATION_TYPE_UNSPECIFIED=0 CLASSIFICATION_TYPE_UNSPECIFIED value + * @property {number} MULTICLASS=1 MULTICLASS value + * @property {number} MULTILABEL=2 MULTILABEL value + */ + v1.ClassificationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULTICLASS"] = 1; + values[valuesById[2] = "MULTILABEL"] = 2; + return values; + })(); + + v1.ClassificationAnnotation = (function() { + + /** + * Properties of a ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IClassificationAnnotation + * @property {number|null} [score] ClassificationAnnotation score + */ + + /** + * Constructs a new ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationAnnotation. + * @implements IClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + */ + function ClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + */ + ClassificationAnnotation.prototype.score = 0; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation instance + */ + ClassificationAnnotation.create = function create(properties) { + return new ClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + */ + ClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.ClassificationAnnotation} message ClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ClassificationAnnotation; + })(); + + v1.ClassificationEvaluationMetrics = (function() { + + /** + * Properties of a ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IClassificationEvaluationMetrics + * @property {number|null} [auPrc] ClassificationEvaluationMetrics auPrc + * @property {number|null} [auRoc] ClassificationEvaluationMetrics auRoc + * @property {number|null} [logLoss] ClassificationEvaluationMetrics logLoss + * @property {Array.|null} [confidenceMetricsEntry] ClassificationEvaluationMetrics confidenceMetricsEntry + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] ClassificationEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] ClassificationEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationEvaluationMetrics. + * @implements IClassificationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + */ + function ClassificationEvaluationMetrics(properties) { + this.confidenceMetricsEntry = []; + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auPrc = 0; + + /** + * ClassificationEvaluationMetrics auRoc. + * @member {number} auRoc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auRoc = 0; + + /** + * ClassificationEvaluationMetrics logLoss. + * @member {number} logLoss + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.logLoss = 0; + + /** + * ClassificationEvaluationMetrics confidenceMetricsEntry. + * @member {Array.} confidenceMetricsEntry + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confidenceMetricsEntry = $util.emptyArray; + + /** + * ClassificationEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * ClassificationEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics instance + */ + ClassificationEvaluationMetrics.create = function create(properties) { + return new ClassificationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntry != null && message.confidenceMetricsEntry.length) + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntry[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.annotationSpecId[i]); + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.auRoc); + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.logLoss); + return writer; + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.auPrc = reader.float(); + break; + case 6: + message.auRoc = reader.float(); + break; + case 7: + message.logLoss = reader.float(); + break; + case 3: + if (!(message.confidenceMetricsEntry && message.confidenceMetricsEntry.length)) + message.confidenceMetricsEntry = []; + message.confidenceMetricsEntry.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + case 4: + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + if (typeof message.auRoc !== "number") + return "auRoc: number expected"; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + if (typeof message.logLoss !== "number") + return "logLoss: number expected"; + if (message.confidenceMetricsEntry != null && message.hasOwnProperty("confidenceMetricsEntry")) { + if (!Array.isArray(message.confidenceMetricsEntry)) + return "confidenceMetricsEntry: array expected"; + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntry[i]); + if (error) + return "confidenceMetricsEntry." + error; + } + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + */ + ClassificationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.auRoc != null) + message.auRoc = Number(object.auRoc); + if (object.logLoss != null) + message.logLoss = Number(object.logLoss); + if (object.confidenceMetricsEntry) { + if (!Array.isArray(object.confidenceMetricsEntry)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: array expected"); + message.confidenceMetricsEntry = []; + for (var i = 0; i < object.confidenceMetricsEntry.length; ++i) { + if (typeof object.confidenceMetricsEntry[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: object expected"); + message.confidenceMetricsEntry[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntry[i]); + } + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics} message ClassificationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceMetricsEntry = []; + object.annotationSpecId = []; + } + if (options.defaults) { + object.auPrc = 0; + object.confusionMatrix = null; + object.auRoc = 0; + object.logLoss = 0; + } + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntry && message.confidenceMetricsEntry.length) { + object.confidenceMetricsEntry = []; + for (var j = 0; j < message.confidenceMetricsEntry.length; ++j) + object.confidenceMetricsEntry[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntry[j], options); + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + object.auRoc = options.json && !isFinite(message.auRoc) ? String(message.auRoc) : message.auRoc; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + object.logLoss = options.json && !isFinite(message.logLoss) ? String(message.logLoss) : message.logLoss; + return object; + }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ClassificationEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [positionThreshold] ConfidenceMetricsEntry positionThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [falsePositiveRate] ConfidenceMetricsEntry falsePositiveRate + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [falsePositiveRateAt1] ConfidenceMetricsEntry falsePositiveRateAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|Long|null} [truePositiveCount] ConfidenceMetricsEntry truePositiveCount + * @property {number|Long|null} [falsePositiveCount] ConfidenceMetricsEntry falsePositiveCount + * @property {number|Long|null} [falseNegativeCount] ConfidenceMetricsEntry falseNegativeCount + * @property {number|Long|null} [trueNegativeCount] ConfidenceMetricsEntry trueNegativeCount + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry positionThreshold. + * @member {number} positionThreshold + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.positionThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRate. + * @member {number} falsePositiveRate + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRate = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRateAt1. + * @member {number} falsePositiveRateAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRateAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry truePositiveCount. + * @member {number|Long} truePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.truePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falsePositiveCount. + * @member {number|Long} falsePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falseNegativeCount. + * @member {number|Long} falseNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falseNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry trueNegativeCount. + * @member {number|Long} trueNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.trueNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && message.hasOwnProperty("recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && message.hasOwnProperty("precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.recallAt1); + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.precisionAt1); + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.f1ScoreAt1); + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.falsePositiveRate); + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.falsePositiveRateAt1); + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.truePositiveCount); + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.falsePositiveCount); + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.falseNegativeCount); + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.trueNegativeCount); + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.positionThreshold); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confidenceThreshold = reader.float(); + break; + case 14: + message.positionThreshold = reader.int32(); + break; + case 2: + message.recall = reader.float(); + break; + case 3: + message.precision = reader.float(); + break; + case 8: + message.falsePositiveRate = reader.float(); + break; + case 4: + message.f1Score = reader.float(); + break; + case 5: + message.recallAt1 = reader.float(); + break; + case 6: + message.precisionAt1 = reader.float(); + break; + case 9: + message.falsePositiveRateAt1 = reader.float(); + break; + case 7: + message.f1ScoreAt1 = reader.float(); + break; + case 10: + message.truePositiveCount = reader.int64(); + break; + case 11: + message.falsePositiveCount = reader.int64(); + break; + case 12: + message.falseNegativeCount = reader.int64(); + break; + case 13: + message.trueNegativeCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + if (!$util.isInteger(message.positionThreshold)) + return "positionThreshold: integer expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + if (typeof message.falsePositiveRate !== "number") + return "falsePositiveRate: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + if (typeof message.recallAt1 !== "number") + return "recallAt1: number expected"; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + if (typeof message.precisionAt1 !== "number") + return "precisionAt1: number expected"; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + if (typeof message.falsePositiveRateAt1 !== "number") + return "falsePositiveRateAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (!$util.isInteger(message.truePositiveCount) && !(message.truePositiveCount && $util.isInteger(message.truePositiveCount.low) && $util.isInteger(message.truePositiveCount.high))) + return "truePositiveCount: integer|Long expected"; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (!$util.isInteger(message.falsePositiveCount) && !(message.falsePositiveCount && $util.isInteger(message.falsePositiveCount.low) && $util.isInteger(message.falsePositiveCount.high))) + return "falsePositiveCount: integer|Long expected"; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (!$util.isInteger(message.falseNegativeCount) && !(message.falseNegativeCount && $util.isInteger(message.falseNegativeCount.low) && $util.isInteger(message.falseNegativeCount.high))) + return "falseNegativeCount: integer|Long expected"; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (!$util.isInteger(message.trueNegativeCount) && !(message.trueNegativeCount && $util.isInteger(message.trueNegativeCount.low) && $util.isInteger(message.trueNegativeCount.high))) + return "trueNegativeCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.positionThreshold != null) + message.positionThreshold = object.positionThreshold | 0; + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.falsePositiveRate != null) + message.falsePositiveRate = Number(object.falsePositiveRate); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.recallAt1 != null) + message.recallAt1 = Number(object.recallAt1); + if (object.precisionAt1 != null) + message.precisionAt1 = Number(object.precisionAt1); + if (object.falsePositiveRateAt1 != null) + message.falsePositiveRateAt1 = Number(object.falsePositiveRateAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.truePositiveCount != null) + if ($util.Long) + (message.truePositiveCount = $util.Long.fromValue(object.truePositiveCount)).unsigned = false; + else if (typeof object.truePositiveCount === "string") + message.truePositiveCount = parseInt(object.truePositiveCount, 10); + else if (typeof object.truePositiveCount === "number") + message.truePositiveCount = object.truePositiveCount; + else if (typeof object.truePositiveCount === "object") + message.truePositiveCount = new $util.LongBits(object.truePositiveCount.low >>> 0, object.truePositiveCount.high >>> 0).toNumber(); + if (object.falsePositiveCount != null) + if ($util.Long) + (message.falsePositiveCount = $util.Long.fromValue(object.falsePositiveCount)).unsigned = false; + else if (typeof object.falsePositiveCount === "string") + message.falsePositiveCount = parseInt(object.falsePositiveCount, 10); + else if (typeof object.falsePositiveCount === "number") + message.falsePositiveCount = object.falsePositiveCount; + else if (typeof object.falsePositiveCount === "object") + message.falsePositiveCount = new $util.LongBits(object.falsePositiveCount.low >>> 0, object.falsePositiveCount.high >>> 0).toNumber(); + if (object.falseNegativeCount != null) + if ($util.Long) + (message.falseNegativeCount = $util.Long.fromValue(object.falseNegativeCount)).unsigned = false; + else if (typeof object.falseNegativeCount === "string") + message.falseNegativeCount = parseInt(object.falseNegativeCount, 10); + else if (typeof object.falseNegativeCount === "number") + message.falseNegativeCount = object.falseNegativeCount; + else if (typeof object.falseNegativeCount === "object") + message.falseNegativeCount = new $util.LongBits(object.falseNegativeCount.low >>> 0, object.falseNegativeCount.high >>> 0).toNumber(); + if (object.trueNegativeCount != null) + if ($util.Long) + (message.trueNegativeCount = $util.Long.fromValue(object.trueNegativeCount)).unsigned = false; + else if (typeof object.trueNegativeCount === "string") + message.trueNegativeCount = parseInt(object.trueNegativeCount, 10); + else if (typeof object.trueNegativeCount === "number") + message.trueNegativeCount = object.trueNegativeCount; + else if (typeof object.trueNegativeCount === "object") + message.trueNegativeCount = new $util.LongBits(object.trueNegativeCount.low >>> 0, object.trueNegativeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + object.recallAt1 = 0; + object.precisionAt1 = 0; + object.f1ScoreAt1 = 0; + object.falsePositiveRate = 0; + object.falsePositiveRateAt1 = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.truePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.truePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falsePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falsePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falseNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falseNegativeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trueNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trueNegativeCount = options.longs === String ? "0" : 0; + object.positionThreshold = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + object.recallAt1 = options.json && !isFinite(message.recallAt1) ? String(message.recallAt1) : message.recallAt1; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + object.precisionAt1 = options.json && !isFinite(message.precisionAt1) ? String(message.precisionAt1) : message.precisionAt1; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + object.f1ScoreAt1 = options.json && !isFinite(message.f1ScoreAt1) ? String(message.f1ScoreAt1) : message.f1ScoreAt1; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + object.falsePositiveRate = options.json && !isFinite(message.falsePositiveRate) ? String(message.falsePositiveRate) : message.falsePositiveRate; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + object.falsePositiveRateAt1 = options.json && !isFinite(message.falsePositiveRateAt1) ? String(message.falsePositiveRateAt1) : message.falsePositiveRateAt1; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (typeof message.truePositiveCount === "number") + object.truePositiveCount = options.longs === String ? String(message.truePositiveCount) : message.truePositiveCount; + else + object.truePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.truePositiveCount) : options.longs === Number ? new $util.LongBits(message.truePositiveCount.low >>> 0, message.truePositiveCount.high >>> 0).toNumber() : message.truePositiveCount; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (typeof message.falsePositiveCount === "number") + object.falsePositiveCount = options.longs === String ? String(message.falsePositiveCount) : message.falsePositiveCount; + else + object.falsePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.falsePositiveCount) : options.longs === Number ? new $util.LongBits(message.falsePositiveCount.low >>> 0, message.falsePositiveCount.high >>> 0).toNumber() : message.falsePositiveCount; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (typeof message.falseNegativeCount === "number") + object.falseNegativeCount = options.longs === String ? String(message.falseNegativeCount) : message.falseNegativeCount; + else + object.falseNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.falseNegativeCount) : options.longs === Number ? new $util.LongBits(message.falseNegativeCount.low >>> 0, message.falseNegativeCount.high >>> 0).toNumber() : message.falseNegativeCount; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (typeof message.trueNegativeCount === "number") + object.trueNegativeCount = options.longs === String ? String(message.trueNegativeCount) : message.trueNegativeCount; + else + object.trueNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.trueNegativeCount) : options.longs === Number ? new $util.LongBits(message.trueNegativeCount.low >>> 0, message.trueNegativeCount.high >>> 0).toNumber() : message.trueNegativeCount; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + object.positionThreshold = message.positionThreshold; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConfidenceMetricsEntry; + })(); + + ClassificationEvaluationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfusionMatrix + * @property {Array.|null} [annotationSpecId] ConfusionMatrix annotationSpecId + * @property {Array.|null} [displayName] ConfusionMatrix displayName + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.annotationSpecId = []; + this.displayName = []; + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrix annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.annotationSpecId = $util.emptyArray; + + /** + * ConfusionMatrix displayName. + * @member {Array.} displayName + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.displayName = $util.emptyArray; + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId[i]); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.displayName.length) + for (var i = 0; i < message.displayName.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName[i]); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + case 3: + if (!(message.displayName && message.displayName.length)) + message.displayName = []; + message.displayName.push(reader.string()); + break; + case 2: + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrix message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (!Array.isArray(message.displayName)) + return "displayName: array expected"; + for (var i = 0; i < message.displayName.length; ++i) + if (!$util.isString(message.displayName[i])) + return "displayName: string[] expected"; + } + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify(message.row[i]); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + if (object.displayName) { + if (!Array.isArray(object.displayName)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.displayName: array expected"); + message.displayName = []; + for (var i = 0; i < object.displayName.length; ++i) + message.displayName[i] = String(object.displayName[i]); + } + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.fromObject(object.row[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} message ConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.annotationSpecId = []; + object.row = []; + object.displayName = []; + } + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.toObject(message.row[j], options); + } + if (message.displayName && message.displayName.length) { + object.displayName = []; + for (var j = 0; j < message.displayName.length; ++j) + object.displayName[j] = message.displayName[j]; + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @interface IRow + * @property {Array.|null} [exampleCount] Row exampleCount + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.exampleCount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row exampleCount. + * @member {Array.} exampleCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.exampleCount = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleCount != null && message.exampleCount.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exampleCount.length; ++i) + writer.int32(message.exampleCount[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.exampleCount && message.exampleCount.length)) + message.exampleCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exampleCount.push(reader.int32()); + } else + message.exampleCount.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!Array.isArray(message.exampleCount)) + return "exampleCount: array expected"; + for (var i = 0; i < message.exampleCount.length; ++i) + if (!$util.isInteger(message.exampleCount[i])) + return "exampleCount: integer[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + if (object.exampleCount) { + if (!Array.isArray(object.exampleCount)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.exampleCount: array expected"); + message.exampleCount = []; + for (var i = 0; i < object.exampleCount.length; ++i) + message.exampleCount[i] = object.exampleCount[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exampleCount = []; + if (message.exampleCount && message.exampleCount.length) { + object.exampleCount = []; + for (var j = 0; j < message.exampleCount.length; ++j) + object.exampleCount[j] = message.exampleCount[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return ClassificationEvaluationMetrics; + })(); + + v1.TextClassificationDatasetMetadata = (function() { + + /** + * Properties of a TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationDatasetMetadata. + * @implements ITextClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + */ + function TextClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + */ + TextClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata instance + */ + TextClassificationDatasetMetadata.create = function create(properties) { + return new TextClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classificationType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + */ + TextClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + switch (object.classificationType) { + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationDatasetMetadata} message TextClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextClassificationDatasetMetadata; + })(); + + v1.TextClassificationModelMetadata = (function() { + + /** + * Properties of a TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType + */ + + /** + * Constructs a new TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationModelMetadata. + * @implements ITextClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + */ + function TextClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata instance + */ + TextClassificationModelMetadata.create = function create(properties) { + return new TextClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.classificationType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + */ + TextClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + switch (object.classificationType) { + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationModelMetadata} message TextClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextClassificationModelMetadata; + })(); + + v1.TextExtractionDatasetMetadata = (function() { + + /** + * Properties of a TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionDatasetMetadata + */ + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionDatasetMetadata. + * @implements ITextExtractionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + */ + function TextExtractionDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata instance + */ + TextExtractionDatasetMetadata.create = function create(properties) { + return new TextExtractionDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + */ + TextExtractionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionDatasetMetadata} message TextExtractionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextExtractionDatasetMetadata; + })(); + + v1.TextExtractionModelMetadata = (function() { + + /** + * Properties of a TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionModelMetadata + */ + + /** + * Constructs a new TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionModelMetadata. + * @implements ITextExtractionModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + */ + function TextExtractionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata instance + */ + TextExtractionModelMetadata.create = function create(properties) { + return new TextExtractionModelMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + */ + TextExtractionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionModelMetadata} message TextExtractionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextExtractionModelMetadata; + })(); + + v1.TextSentimentDatasetMetadata = (function() { + + /** + * Properties of a TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentDatasetMetadata + * @property {number|null} [sentimentMax] TextSentimentDatasetMetadata sentimentMax + */ + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentDatasetMetadata. + * @implements ITextSentimentDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + */ + function TextSentimentDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentDatasetMetadata sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + */ + TextSentimentDatasetMetadata.prototype.sentimentMax = 0; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata instance + */ + TextSentimentDatasetMetadata.create = function create(properties) { + return new TextSentimentDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sentimentMax = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + */ + TextSentimentDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentDatasetMetadata} message TextSentimentDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSentimentDatasetMetadata; + })(); + + v1.TextSentimentModelMetadata = (function() { + + /** + * Properties of a TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentModelMetadata + */ + + /** + * Constructs a new TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentModelMetadata. + * @implements ITextSentimentModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + */ + function TextSentimentModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata instance + */ + TextSentimentModelMetadata.create = function create(properties) { + return new TextSentimentModelMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + */ + TextSentimentModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + }; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentModelMetadata} message TextSentimentModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSentimentModelMetadata; + })(); + + v1.TranslationDatasetMetadata = (function() { + + /** + * Properties of a TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationDatasetMetadata + * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationDatasetMetadata. + * @implements ITranslationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + */ + function TranslationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationDatasetMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationDatasetMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + */ + TranslationDatasetMetadata.create = function create(properties) { + return new TranslationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourceLanguageCode = reader.string(); + break; + case 2: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + */ + TranslationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslationDatasetMetadata; + })(); + + v1.TranslationEvaluationMetrics = (function() { + + /** + * Properties of a TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITranslationEvaluationMetrics + * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore + * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + */ + + /** + * Constructs a new TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationEvaluationMetrics. + * @implements ITranslationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + */ + function TranslationEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationEvaluationMetrics bleuScore. + * @member {number} bleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.bleuScore = 0; + + /** + * TranslationEvaluationMetrics baseBleuScore. + * @member {number} baseBleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + */ + TranslationEvaluationMetrics.create = function create(properties) { + return new TranslationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + return writer; + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bleuScore = reader.double(); + break; + case 2: + message.baseBleuScore = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + if (typeof message.bleuScore !== "number") + return "bleuScore: number expected"; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + if (typeof message.baseBleuScore !== "number") + return "baseBleuScore: number expected"; + return null; + }; + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + */ + TranslationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + if (object.bleuScore != null) + message.bleuScore = Number(object.bleuScore); + if (object.baseBleuScore != null) + message.baseBleuScore = Number(object.baseBleuScore); + return message; + }; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bleuScore = 0; + object.baseBleuScore = 0; + } + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + return object; + }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslationEvaluationMetrics; + })(); + + v1.TranslationModelMetadata = (function() { + + /** + * Properties of a TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationModelMetadata + * @property {string|null} [baseModel] TranslationModelMetadata baseModel + * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationModelMetadata. + * @implements ITranslationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + */ + function TranslationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationModelMetadata baseModel. + * @member {string} baseModel + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.baseModel = ""; + + /** + * TranslationModelMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationModelMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata instance + */ + TranslationModelMetadata.create = function create(properties) { + return new TranslationModelMetadata(properties); + }; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseModel = reader.string(); + break; + case 2: + message.sourceLanguageCode = reader.string(); + break; + case 3: + message.targetLanguageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + */ + TranslationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.TranslationModelMetadata} message TranslationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModel = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslationModelMetadata; + })(); + + v1.TranslationAnnotation = (function() { + + /** + * Properties of a TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITranslationAnnotation + * @property {google.cloud.automl.v1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + */ + + /** + * Constructs a new TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationAnnotation. + * @implements ITranslationAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + */ + function TranslationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationAnnotation translatedContent. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} translatedContent + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + */ + TranslationAnnotation.prototype.translatedContent = null; + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation instance + */ + TranslationAnnotation.create = function create(properties) { + return new TranslationAnnotation(properties); + }; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.translatedContent); + if (error) + return "translatedContent." + error; + } + return null; + }; + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + */ + TranslationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + if (object.translatedContent != null) { + if (typeof object.translatedContent !== "object") + throw TypeError(".google.cloud.automl.v1.TranslationAnnotation.translatedContent: object expected"); + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.translatedContent); + } + return message; + }; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.TranslationAnnotation} message TranslationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.translatedContent = null; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + object.translatedContent = $root.google.cloud.automl.v1.TextSnippet.toObject(message.translatedContent, options); + return object; + }; + + /** + * Converts this TranslationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TranslationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TranslationAnnotation; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.automl.v1 + * @interface IImage + * @property {Uint8Array|null} [imageBytes] Image imageBytes + * @property {string|null} [thumbnailUri] Image thumbnailUri + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageBytes. + * @member {Uint8Array} imageBytes + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.imageBytes = $util.newBuffer([]); + + /** + * Image thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.thumbnailUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image data. + * @member {"imageBytes"|undefined} data + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["imageBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageBytes); + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUri); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.imageBytes = reader.bytes(); + break; + case 4: + message.thumbnailUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + properties.data = 1; + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Image) + return object; + var message = new $root.google.cloud.automl.v1.Image(); + if (object.imageBytes != null) + if (typeof object.imageBytes === "string") + $util.base64.decode(object.imageBytes, message.imageBytes = $util.newBuffer($util.base64.length(object.imageBytes)), 0); + else if (object.imageBytes.length) + message.imageBytes = object.imageBytes; + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.thumbnailUri = ""; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + object.imageBytes = options.bytes === String ? $util.base64.encode(message.imageBytes, 0, message.imageBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageBytes) : message.imageBytes; + if (options.oneofs) + object.data = "imageBytes"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + v1.TextSnippet = (function() { + + /** + * Properties of a TextSnippet. + * @memberof google.cloud.automl.v1 + * @interface ITextSnippet + * @property {string|null} [content] TextSnippet content + * @property {string|null} [mimeType] TextSnippet mimeType + * @property {string|null} [contentUri] TextSnippet contentUri + */ + + /** + * Constructs a new TextSnippet. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSnippet. + * @implements ITextSnippet + * @constructor + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + */ + function TextSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSnippet content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.content = ""; + + /** + * TextSnippet mimeType. + * @member {string} mimeType + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.mimeType = ""; + + /** + * TextSnippet contentUri. + * @member {string} contentUri + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.contentUri = ""; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet instance + */ + TextSnippet.create = function create(properties) { + return new TextSnippet(properties); + }; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = reader.string(); + break; + case 2: + message.mimeType = reader.string(); + break; + case 4: + message.contentUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSnippet message. + * @function verify + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSnippet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + return null; + }; + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + */ + TextSnippet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSnippet) + return object; + var message = new $root.google.cloud.automl.v1.TextSnippet(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.TextSnippet} message TextSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.contentUri = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + object.contentUri = message.contentUri; + return object; + }; + + /** + * Converts this TextSnippet to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + * @returns {Object.} JSON object + */ + TextSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSnippet; + })(); + + v1.DocumentDimensions = (function() { + + /** + * Properties of a DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @interface IDocumentDimensions + * @property {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null} [unit] DocumentDimensions unit + * @property {number|null} [width] DocumentDimensions width + * @property {number|null} [height] DocumentDimensions height + */ + + /** + * Constructs a new DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentDimensions. + * @implements IDocumentDimensions + * @constructor + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + */ + function DocumentDimensions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentDimensions unit. + * @member {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit} unit + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.unit = 0; + + /** + * DocumentDimensions width. + * @member {number} width + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.width = 0; + + /** + * DocumentDimensions height. + * @member {number} height + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.height = 0; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions instance + */ + DocumentDimensions.create = function create(properties) { + return new DocumentDimensions(properties); + }; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unit != null && message.hasOwnProperty("unit")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unit); + if (message.width != null && message.hasOwnProperty("width")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.width); + if (message.height != null && message.hasOwnProperty("height")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.height); + return writer; + }; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentDimensions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unit = reader.int32(); + break; + case 2: + message.width = reader.float(); + break; + case 3: + message.height = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDimensions message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDimensions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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 DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + */ + DocumentDimensions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentDimensions) + return object; + var message = new $root.google.cloud.automl.v1.DocumentDimensions(); + switch (object.unit) { + case "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "INCH": + case 1: + message.unit = 1; + break; + case "CENTIMETER": + case 2: + message.unit = 2; + break; + case "POINT": + case 3: + message.unit = 3; + break; + } + 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 DocumentDimensions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.DocumentDimensions} message DocumentDimensions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentDimensions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unit = options.enums === String ? "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED" : 0; + object.width = 0; + object.height = 0; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit[message.unit] : message.unit; + 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 DocumentDimensions to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + * @returns {Object.} JSON object + */ + DocumentDimensions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * DocumentDimensionUnit enum. + * @name google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + * @enum {string} + * @property {number} DOCUMENT_DIMENSION_UNIT_UNSPECIFIED=0 DOCUMENT_DIMENSION_UNIT_UNSPECIFIED value + * @property {number} INCH=1 INCH value + * @property {number} CENTIMETER=2 CENTIMETER value + * @property {number} POINT=3 POINT value + */ + DocumentDimensions.DocumentDimensionUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCH"] = 1; + values[valuesById[2] = "CENTIMETER"] = 2; + values[valuesById[3] = "POINT"] = 3; + return values; + })(); + + return DocumentDimensions; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.automl.v1 + * @interface IDocument + * @property {google.cloud.automl.v1.IDocumentInputConfig|null} [inputConfig] Document inputConfig + * @property {google.cloud.automl.v1.ITextSnippet|null} [documentText] Document documentText + * @property {Array.|null} [layout] Document layout + * @property {google.cloud.automl.v1.IDocumentDimensions|null} [documentDimensions] Document documentDimensions + * @property {number|null} [pageCount] Document pageCount + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.layout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document inputConfig. + * @member {google.cloud.automl.v1.IDocumentInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.inputConfig = null; + + /** + * Document documentText. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} documentText + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentText = null; + + /** + * Document layout. + * @member {Array.} layout + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.layout = $util.emptyArray; + + /** + * Document documentDimensions. + * @member {google.cloud.automl.v1.IDocumentDimensions|null|undefined} documentDimensions + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentDimensions = null; + + /** + * Document pageCount. + * @member {number} pageCount + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.pageCount = 0; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.automl.v1.DocumentInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentText != null && message.hasOwnProperty("documentText")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.documentText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && message.layout.length) + for (var i = 0; i < message.layout.length; ++i) + $root.google.cloud.automl.v1.Document.Layout.encode(message.layout[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + $root.google.cloud.automl.v1.DocumentDimensions.encode(message.documentDimensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageCount); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + case 2: + message.documentText = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.layout && message.layout.length)) + message.layout = []; + message.layout.push($root.google.cloud.automl.v1.Document.Layout.decode(reader, reader.uint32())); + break; + case 4: + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.decode(reader, reader.uint32()); + break; + case 5: + message.pageCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.DocumentInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.documentText != null && message.hasOwnProperty("documentText")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.documentText); + if (error) + return "documentText." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + if (!Array.isArray(message.layout)) + return "layout: array expected"; + for (var i = 0; i < message.layout.length; ++i) { + var error = $root.google.cloud.automl.v1.Document.Layout.verify(message.layout[i]); + if (error) + return "layout." + error; + } + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) { + var error = $root.google.cloud.automl.v1.DocumentDimensions.verify(message.documentDimensions); + if (error) + return "documentDimensions." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document) + return object; + var message = new $root.google.cloud.automl.v1.Document(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.Document.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.fromObject(object.inputConfig); + } + if (object.documentText != null) { + if (typeof object.documentText !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentText: object expected"); + message.documentText = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.documentText); + } + if (object.layout) { + if (!Array.isArray(object.layout)) + throw TypeError(".google.cloud.automl.v1.Document.layout: array expected"); + message.layout = []; + for (var i = 0; i < object.layout.length; ++i) { + if (typeof object.layout[i] !== "object") + throw TypeError(".google.cloud.automl.v1.Document.layout: object expected"); + message.layout[i] = $root.google.cloud.automl.v1.Document.Layout.fromObject(object.layout[i]); + } + } + if (object.documentDimensions != null) { + if (typeof object.documentDimensions !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentDimensions: object expected"); + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.fromObject(object.documentDimensions); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.layout = []; + if (options.defaults) { + object.inputConfig = null; + object.documentText = null; + object.documentDimensions = null; + object.pageCount = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.toObject(message.inputConfig, options); + if (message.documentText != null && message.hasOwnProperty("documentText")) + object.documentText = $root.google.cloud.automl.v1.TextSnippet.toObject(message.documentText, options); + if (message.layout && message.layout.length) { + object.layout = []; + for (var j = 0; j < message.layout.length; ++j) + object.layout[j] = $root.google.cloud.automl.v1.Document.Layout.toObject(message.layout[j], options); + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + object.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.toObject(message.documentDimensions, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Document.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.automl.v1.Document + * @interface ILayout + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] Layout textSegment + * @property {number|null} [pageNumber] Layout pageNumber + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.automl.v1.Document.Layout.TextSegmentType|null} [textSegmentType] Layout textSegmentType + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.automl.v1.Document + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + */ + function Layout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Layout textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegment = null; + + /** + * Layout pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.pageNumber = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout textSegmentType. + * @member {google.cloud.automl.v1.Document.Layout.TextSegmentType} textSegmentType + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegmentType = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.textSegmentType); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + case 2: + message.pageNumber = reader.int32(); + break; + case 3: + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 4: + message.textSegmentType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + switch (message.textSegmentType) { + default: + return "textSegmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document.Layout) + return object; + var message = new $root.google.cloud.automl.v1.Document.Layout(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.textSegmentType) { + case "TEXT_SEGMENT_TYPE_UNSPECIFIED": + case 0: + message.textSegmentType = 0; + break; + case "TOKEN": + case 1: + message.textSegmentType = 1; + break; + case "PARAGRAPH": + case 2: + message.textSegmentType = 2; + break; + case "FORM_FIELD": + case 3: + message.textSegmentType = 3; + break; + case "FORM_FIELD_NAME": + case 4: + message.textSegmentType = 4; + break; + case "FORM_FIELD_CONTENTS": + case 5: + message.textSegmentType = 5; + break; + case "TABLE": + case 6: + message.textSegmentType = 6; + break; + case "TABLE_HEADER": + case 7: + message.textSegmentType = 7; + break; + case "TABLE_ROW": + case 8: + message.textSegmentType = 8; + break; + case "TABLE_CELL": + case 9: + message.textSegmentType = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textSegment = null; + object.pageNumber = 0; + object.boundingPoly = null; + object.textSegmentType = options.enums === String ? "TEXT_SEGMENT_TYPE_UNSPECIFIED" : 0; + } + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + object.textSegmentType = options.enums === String ? $root.google.cloud.automl.v1.Document.Layout.TextSegmentType[message.textSegmentType] : message.textSegmentType; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * TextSegmentType enum. + * @name google.cloud.automl.v1.Document.Layout.TextSegmentType + * @enum {string} + * @property {number} TEXT_SEGMENT_TYPE_UNSPECIFIED=0 TEXT_SEGMENT_TYPE_UNSPECIFIED value + * @property {number} TOKEN=1 TOKEN value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} FORM_FIELD=3 FORM_FIELD value + * @property {number} FORM_FIELD_NAME=4 FORM_FIELD_NAME value + * @property {number} FORM_FIELD_CONTENTS=5 FORM_FIELD_CONTENTS value + * @property {number} TABLE=6 TABLE value + * @property {number} TABLE_HEADER=7 TABLE_HEADER value + * @property {number} TABLE_ROW=8 TABLE_ROW value + * @property {number} TABLE_CELL=9 TABLE_CELL value + */ + Layout.TextSegmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEXT_SEGMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOKEN"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "FORM_FIELD"] = 3; + values[valuesById[4] = "FORM_FIELD_NAME"] = 4; + values[valuesById[5] = "FORM_FIELD_CONTENTS"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "TABLE_HEADER"] = 7; + values[valuesById[8] = "TABLE_ROW"] = 8; + values[valuesById[9] = "TABLE_CELL"] = 9; + return values; + })(); + + return Layout; + })(); + + return Document; + })(); + + v1.ExamplePayload = (function() { + + /** + * Properties of an ExamplePayload. + * @memberof google.cloud.automl.v1 + * @interface IExamplePayload + * @property {google.cloud.automl.v1.IImage|null} [image] ExamplePayload image + * @property {google.cloud.automl.v1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @property {google.cloud.automl.v1.IDocument|null} [document] ExamplePayload document + */ + + /** + * Constructs a new ExamplePayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExamplePayload. + * @implements IExamplePayload + * @constructor + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + */ + function ExamplePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplePayload image. + * @member {google.cloud.automl.v1.IImage|null|undefined} image + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.image = null; + + /** + * ExamplePayload textSnippet. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} textSnippet + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.textSnippet = null; + + /** + * ExamplePayload document. + * @member {google.cloud.automl.v1.IDocument|null|undefined} document + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.document = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExamplePayload payload. + * @member {"image"|"textSnippet"|"document"|undefined} payload + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + Object.defineProperty(ExamplePayload.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["image", "textSnippet", "document"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload instance + */ + ExamplePayload.create = function create(properties) { + return new ExamplePayload(properties); + }; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && message.hasOwnProperty("image")) + $root.google.cloud.automl.v1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.document != null && message.hasOwnProperty("document")) + $root.google.cloud.automl.v1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExamplePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = $root.google.cloud.automl.v1.Image.decode(reader, reader.uint32()); + break; + case 2: + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + case 4: + message.document = $root.google.cloud.automl.v1.Document.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplePayload message. + * @function verify + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.textSnippet); + if (error) + return "textSnippet." + error; + } + } + if (message.document != null && message.hasOwnProperty("document")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + } + return null; + }; + + /** + * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + */ + ExamplePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExamplePayload) + return object; + var message = new $root.google.cloud.automl.v1.ExamplePayload(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.image: object expected"); + message.image = $root.google.cloud.automl.v1.Image.fromObject(object.image); + } + if (object.textSnippet != null) { + if (typeof object.textSnippet !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.textSnippet: object expected"); + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.textSnippet); + } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.document: object expected"); + message.document = $root.google.cloud.automl.v1.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.ExamplePayload} message ExamplePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.automl.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.payload = "image"; + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + object.textSnippet = $root.google.cloud.automl.v1.TextSnippet.toObject(message.textSnippet, options); + if (options.oneofs) + object.payload = "textSnippet"; + } + if (message.document != null && message.hasOwnProperty("document")) { + object.document = $root.google.cloud.automl.v1.Document.toObject(message.document, options); + if (options.oneofs) + object.payload = "document"; + } + return object; + }; + + /** + * Converts this ExamplePayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + * @returns {Object.} JSON object + */ + ExamplePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExamplePayload; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.automl.v1.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) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.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 && message.hasOwnProperty("x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && message.hasOwnProperty("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.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.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.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.x = reader.float(); + break; + case 2: + message.y = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.automl.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.automl.v1.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.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.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.automl.v1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NormalizedVertex; + })(); + + v1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.automl.v1 + * @interface IBoundingPoly + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.automl.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.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.automl.v1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.automl.v1.NormalizedVertex.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPoly message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.automl.v1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingPoly) + return object; + var message = new $root.google.cloud.automl.v1.BoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.automl.v1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.BoundingPoly} message BoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPoly.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.automl.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoundingPoly; + })(); + + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.automl.v1 + * @interface IInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {Object.|null} [params] InputConfig params + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && message.hasOwnProperty("params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.InputConfig(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + case 2: + reader.skip().pos++; + if (message.params === $util.emptyObject) + message.params = {}; + key = reader.string(); + reader.pos++; + message.params[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.InputConfig) + return object; + var message = new $root.google.cloud.automl.v1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputConfig; + })(); + + v1.BatchPredictInputConfig = (function() { + + /** + * Properties of a BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] BatchPredictInputConfig gcsSource + */ + + /** + * Constructs a new BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictInputConfig. + * @implements IBatchPredictInputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + */ + function BatchPredictInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + Object.defineProperty(BatchPredictInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig instance + */ + BatchPredictInputConfig.create = function create(properties) { + return new BatchPredictInputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + */ + BatchPredictInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictInputConfig} message BatchPredictInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchPredictInputConfig; + })(); + + v1.DocumentInputConfig = (function() { + + /** + * Properties of a DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IDocumentInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + */ + + /** + * Constructs a new DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig + * @constructor + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + */ + function DocumentInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + */ + DocumentInputConfig.prototype.gcsSource = null; + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig instance + */ + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); + }; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + return null; + }; + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + */ + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.DocumentInputConfig} message DocumentInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsSource = null; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + return object; + }; + + /** + * Converts this DocumentInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DocumentInputConfig; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputConfig; + })(); + + v1.BatchPredictOutputConfig = (function() { + + /** + * Properties of a BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] BatchPredictOutputConfig gcsDestination + */ + + /** + * Constructs a new BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictOutputConfig. + * @implements IBatchPredictOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + */ + function BatchPredictOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + Object.defineProperty(BatchPredictOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig instance + */ + BatchPredictOutputConfig.create = function create(properties) { + return new BatchPredictOutputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + */ + BatchPredictOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictOutputConfig} message BatchPredictOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchPredictOutputConfig; + })(); + + v1.ModelExportOutputConfig = (function() { + + /** + * Properties of a ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IModelExportOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] ModelExportOutputConfig gcsDestination + * @property {string|null} [modelFormat] ModelExportOutputConfig modelFormat + * @property {Object.|null} [params] ModelExportOutputConfig params + */ + + /** + * Constructs a new ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelExportOutputConfig. + * @implements IModelExportOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + */ + function ModelExportOutputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExportOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcsDestination = null; + + /** + * ModelExportOutputConfig modelFormat. + * @member {string} modelFormat + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.modelFormat = ""; + + /** + * ModelExportOutputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelExportOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + Object.defineProperty(ModelExportOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig instance + */ + ModelExportOutputConfig.create = function create(properties) { + return new ModelExportOutputConfig(properties); + }; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && message.hasOwnProperty("params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelFormat); + return writer; + }; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + case 4: + message.modelFormat = reader.string(); + break; + case 2: + reader.skip().pos++; + if (message.params === $util.emptyObject) + message.params = {}; + key = reader.string(); + reader.pos++; + message.params[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExportOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExportOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + if (!$util.isString(message.modelFormat)) + return "modelFormat: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + */ + ModelExportOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelExportOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.modelFormat != null) + message.modelFormat = String(object.modelFormat); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.ModelExportOutputConfig} message ModelExportOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExportOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.modelFormat = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + object.modelFormat = message.modelFormat; + return object; + }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ModelExportOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ModelExportOutputConfig; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.automl.v1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.automl.v1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: 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.automl.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsSource) + return object; + var message = new $root.google.cloud.automl.v1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.automl.v1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.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.inputUris = []; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.automl.v1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.automl.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputUriPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsDestination) + return object; + var message = new $root.google.cloud.automl.v1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsDestination; + })(); + + v1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.automl.v1 + * @interface ITextSegment + * @property {string|null} [content] TextSegment content + * @property {number|Long|null} [startOffset] TextSegment startOffset + * @property {number|Long|null} [endOffset] TextSegment endOffset + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.content = ""; + + /** + * TextSegment startOffset. + * @member {number|Long} startOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.startOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endOffset. + * @member {number|Long} endOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.endOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startOffset); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endOffset); + if (message.content != null && message.hasOwnProperty("content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.content = reader.string(); + break; + case 1: + message.startOffset = reader.int64(); + break; + case 2: + message.endOffset = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset) && !(message.startOffset && $util.isInteger(message.startOffset.low) && $util.isInteger(message.startOffset.high))) + return "startOffset: integer|Long expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset) && !(message.endOffset && $util.isInteger(message.endOffset.low) && $util.isInteger(message.endOffset.high))) + return "endOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSegment) + return object; + var message = new $root.google.cloud.automl.v1.TextSegment(); + if (object.content != null) + message.content = String(object.content); + if (object.startOffset != null) + if ($util.Long) + (message.startOffset = $util.Long.fromValue(object.startOffset)).unsigned = false; + else if (typeof object.startOffset === "string") + message.startOffset = parseInt(object.startOffset, 10); + else if (typeof object.startOffset === "number") + message.startOffset = object.startOffset; + else if (typeof object.startOffset === "object") + message.startOffset = new $util.LongBits(object.startOffset.low >>> 0, object.startOffset.high >>> 0).toNumber(); + if (object.endOffset != null) + if ($util.Long) + (message.endOffset = $util.Long.fromValue(object.endOffset)).unsigned = false; + else if (typeof object.endOffset === "string") + message.endOffset = parseInt(object.endOffset, 10); + else if (typeof object.endOffset === "number") + message.endOffset = object.endOffset; + else if (typeof object.endOffset === "object") + message.endOffset = new $util.LongBits(object.endOffset.low >>> 0, object.endOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.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.startOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endOffset = options.longs === String ? "0" : 0; + object.content = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (typeof message.startOffset === "number") + object.startOffset = options.longs === String ? String(message.startOffset) : message.startOffset; + else + object.startOffset = options.longs === String ? $util.Long.prototype.toString.call(message.startOffset) : options.longs === Number ? new $util.LongBits(message.startOffset.low >>> 0, message.startOffset.high >>> 0).toNumber() : message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (typeof message.endOffset === "number") + object.endOffset = options.longs === String ? String(message.endOffset) : message.endOffset; + else + object.endOffset = options.longs === String ? $util.Long.prototype.toString.call(message.endOffset) : options.longs === Number ? new $util.LongBits(message.endOffset.low >>> 0, message.endOffset.high >>> 0).toNumber() : message.endOffset; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSegment; + })(); + + v1.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.automl.v1 + * @interface IModel + * @property {google.cloud.automl.v1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelMetadata|null} [imageClassificationModelMetadata] Model imageClassificationModelMetadata + * @property {google.cloud.automl.v1.ITextClassificationModelMetadata|null} [textClassificationModelMetadata] Model textClassificationModelMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null} [imageObjectDetectionModelMetadata] Model imageObjectDetectionModelMetadata + * @property {google.cloud.automl.v1.ITextExtractionModelMetadata|null} [textExtractionModelMetadata] Model textExtractionModelMetadata + * @property {google.cloud.automl.v1.ITextSentimentModelMetadata|null} [textSentimentModelMetadata] Model textSentimentModelMetadata + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {string|null} [datasetId] Model datasetId + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {google.cloud.automl.v1.Model.DeploymentState|null} [deploymentState] Model deploymentState + * @property {string|null} [etag] Model etag + * @property {Object.|null} [labels] Model labels + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model translationModelMetadata. + * @member {google.cloud.automl.v1.ITranslationModelMetadata|null|undefined} translationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.translationModelMetadata = null; + + /** + * Model imageClassificationModelMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelMetadata|null|undefined} imageClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageClassificationModelMetadata = null; + + /** + * Model textClassificationModelMetadata. + * @member {google.cloud.automl.v1.ITextClassificationModelMetadata|null|undefined} textClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textClassificationModelMetadata = null; + + /** + * Model imageObjectDetectionModelMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null|undefined} imageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageObjectDetectionModelMetadata = null; + + /** + * Model textExtractionModelMetadata. + * @member {google.cloud.automl.v1.ITextExtractionModelMetadata|null|undefined} textExtractionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textExtractionModelMetadata = null; + + /** + * Model textSentimentModelMetadata. + * @member {google.cloud.automl.v1.ITextSentimentModelMetadata|null|undefined} textSentimentModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textSentimentModelMetadata = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model datasetId. + * @member {string} datasetId + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.datasetId = ""; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model deploymentState. + * @member {google.cloud.automl.v1.Model.DeploymentState} deploymentState + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.deploymentState = 0; + + /** + * Model etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.etag = ""; + + /** + * Model labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model modelMetadata. + * @member {"translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"|undefined} modelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata", "imageClassificationModelMetadata", "textClassificationModelMetadata", "imageObjectDetectionModelMetadata", "textExtractionModelMetadata", "textSentimentModelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelMetadata.encode(message.imageClassificationModelMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) + $root.google.cloud.automl.v1.TextClassificationModelMetadata.encode(message.textClassificationModelMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) + $root.google.cloud.automl.v1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) + $root.google.cloud.automl.v1.TextExtractionModelMetadata.encode(message.textExtractionModelMetadata, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.encode(message.imageObjectDetectionModelMetadata, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) + $root.google.cloud.automl.v1.TextSentimentModelMetadata.encode(message.textSentimentModelMetadata, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Model(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.decode(reader, reader.uint32()); + break; + case 13: + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.decode(reader, reader.uint32()); + break; + case 14: + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.decode(reader, reader.uint32()); + break; + case 20: + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.decode(reader, reader.uint32()); + break; + case 19: + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.decode(reader, reader.uint32()); + break; + case 22: + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.datasetId = reader.string(); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.deploymentState = reader.int32(); + break; + case 10: + message.etag = reader.string(); + break; + case 34: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationModelMetadata.verify(message.translationModelMetadata); + if (error) + return "translationModelMetadata." + error; + } + } + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.verify(message.imageClassificationModelMetadata); + if (error) + return "imageClassificationModelMetadata." + error; + } + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationModelMetadata.verify(message.textClassificationModelMetadata); + if (error) + return "textClassificationModelMetadata." + error; + } + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify(message.imageObjectDetectionModelMetadata); + if (error) + return "imageObjectDetectionModelMetadata." + error; + } + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionModelMetadata.verify(message.textExtractionModelMetadata); + if (error) + return "textExtractionModelMetadata." + error; + } + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentModelMetadata.verify(message.textSentimentModelMetadata); + if (error) + return "textSentimentModelMetadata." + error; + } + } + 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.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + switch (message.deploymentState) { + default: + return "deploymentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + 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"; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Model) + return object; + var message = new $root.google.cloud.automl.v1.Model(); + if (object.translationModelMetadata != null) { + if (typeof object.translationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.translationModelMetadata: object expected"); + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.fromObject(object.translationModelMetadata); + } + if (object.imageClassificationModelMetadata != null) { + if (typeof object.imageClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageClassificationModelMetadata: object expected"); + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.fromObject(object.imageClassificationModelMetadata); + } + if (object.textClassificationModelMetadata != null) { + if (typeof object.textClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textClassificationModelMetadata: object expected"); + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.fromObject(object.textClassificationModelMetadata); + } + if (object.imageObjectDetectionModelMetadata != null) { + if (typeof object.imageObjectDetectionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageObjectDetectionModelMetadata: object expected"); + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.fromObject(object.imageObjectDetectionModelMetadata); + } + if (object.textExtractionModelMetadata != null) { + if (typeof object.textExtractionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textExtractionModelMetadata: object expected"); + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.fromObject(object.textExtractionModelMetadata); + } + if (object.textSentimentModelMetadata != null) { + if (typeof object.textSentimentModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textSentimentModelMetadata: object expected"); + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.fromObject(object.textSentimentModelMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Model.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.automl.v1.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.deploymentState) { + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.deploymentState = 0; + break; + case "DEPLOYED": + case 1: + message.deploymentState = 1; + break; + case "UNDEPLOYED": + case 2: + message.deploymentState = 2; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Model.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.datasetId = ""; + object.createTime = null; + object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.updateTime = 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.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] : message.deploymentState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + object.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.toObject(message.imageClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageClassificationModelMetadata"; + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + object.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.toObject(message.textClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textClassificationModelMetadata"; + } + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + object.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "translationModelMetadata"; + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + object.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.toObject(message.textExtractionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textExtractionModelMetadata"; + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + object.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.toObject(message.imageObjectDetectionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageObjectDetectionModelMetadata"; + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + object.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.toObject(message.textSentimentModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textSentimentModelMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * DeploymentState enum. + * @name google.cloud.automl.v1.Model.DeploymentState + * @enum {string} + * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} UNDEPLOYED=2 UNDEPLOYED value + */ + Model.DeploymentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "UNDEPLOYED"] = 2; + return values; + })(); + + return Model; + })(); + + v1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @interface IModelEvaluation + * @property {google.cloud.automl.v1.IClassificationEvaluationMetrics|null} [classificationEvaluationMetrics] ModelEvaluation classificationEvaluationMetrics + * @property {google.cloud.automl.v1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics + * @property {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null} [imageObjectDetectionEvaluationMetrics] ModelEvaluation imageObjectDetectionEvaluationMetrics + * @property {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null} [textSentimentEvaluationMetrics] ModelEvaluation textSentimentEvaluationMetrics + * @property {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null} [textExtractionEvaluationMetrics] ModelEvaluation textExtractionEvaluationMetrics + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation classificationEvaluationMetrics. + * @member {google.cloud.automl.v1.IClassificationEvaluationMetrics|null|undefined} classificationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.classificationEvaluationMetrics = null; + + /** + * ModelEvaluation translationEvaluationMetrics. + * @member {google.cloud.automl.v1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.translationEvaluationMetrics = null; + + /** + * ModelEvaluation imageObjectDetectionEvaluationMetrics. + * @member {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null|undefined} imageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.imageObjectDetectionEvaluationMetrics = null; + + /** + * ModelEvaluation textSentimentEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null|undefined} textSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textSentimentEvaluationMetrics = null; + + /** + * ModelEvaluation textExtractionEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null|undefined} textExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textExtractionEvaluationMetrics = null; + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSpecId = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation evaluatedExampleCount. + * @member {number} evaluatedExampleCount + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.evaluatedExampleCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelEvaluation metrics. + * @member {"classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"|undefined} metrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + Object.defineProperty(ModelEvaluation.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationEvaluationMetrics", "translationEvaluationMetrics", "imageObjectDetectionEvaluationMetrics", "textSentimentEvaluationMetrics", "textExtractionEvaluationMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.encode(message.classificationEvaluationMetrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) + $root.google.cloud.automl.v1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) + $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.encode(message.textSentimentEvaluationMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) + $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.encode(message.imageObjectDetectionEvaluationMetrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.encode(message.textExtractionEvaluationMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.decode(reader, reader.uint32()); + break; + case 9: + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); + break; + case 12: + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.decode(reader, reader.uint32()); + break; + case 11: + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.decode(reader, reader.uint32()); + break; + case 13: + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); + break; + case 2: + message.annotationSpecId = reader.string(); + break; + case 15: + message.displayName = reader.string(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.evaluatedExampleCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.verify(message.classificationEvaluationMetrics); + if (error) + return "classificationEvaluationMetrics." + error; + } + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); + if (error) + return "translationEvaluationMetrics." + error; + } + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify(message.imageObjectDetectionEvaluationMetrics); + if (error) + return "imageObjectDetectionEvaluationMetrics." + error; + } + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify(message.textSentimentEvaluationMetrics); + if (error) + return "textSentimentEvaluationMetrics." + error; + } + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify(message.textExtractionEvaluationMetrics); + if (error) + return "textExtractionEvaluationMetrics." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + if (!$util.isInteger(message.evaluatedExampleCount)) + return "evaluatedExampleCount: integer expected"; + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelEvaluation) + return object; + var message = new $root.google.cloud.automl.v1.ModelEvaluation(); + if (object.classificationEvaluationMetrics != null) { + if (typeof object.classificationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.classificationEvaluationMetrics: object expected"); + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.fromObject(object.classificationEvaluationMetrics); + } + if (object.translationEvaluationMetrics != null) { + if (typeof object.translationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.translationEvaluationMetrics: object expected"); + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + } + if (object.imageObjectDetectionEvaluationMetrics != null) { + if (typeof object.imageObjectDetectionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.imageObjectDetectionEvaluationMetrics: object expected"); + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.fromObject(object.imageObjectDetectionEvaluationMetrics); + } + if (object.textSentimentEvaluationMetrics != null) { + if (typeof object.textSentimentEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textSentimentEvaluationMetrics: object expected"); + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.fromObject(object.textSentimentEvaluationMetrics); + } + if (object.textExtractionEvaluationMetrics != null) { + if (typeof object.textExtractionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textExtractionEvaluationMetrics: object expected"); + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.fromObject(object.textExtractionEvaluationMetrics); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluatedExampleCount != null) + message.evaluatedExampleCount = object.evaluatedExampleCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotationSpecId = ""; + object.createTime = null; + object.evaluatedExampleCount = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + object.evaluatedExampleCount = message.evaluatedExampleCount; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + object.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.toObject(message.classificationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "classificationEvaluationMetrics"; + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + object.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "translationEvaluationMetrics"; + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + object.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.toObject(message.textSentimentEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textSentimentEvaluationMetrics"; + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + object.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.toObject(message.imageObjectDetectionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "imageObjectDetectionEvaluationMetrics"; + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + object.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.toObject(message.textExtractionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textExtractionEvaluationMetrics"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ModelEvaluation; + })(); + + v1.ImageObjectDetectionAnnotation = (function() { + + /** + * Properties of an ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionAnnotation + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingBox] ImageObjectDetectionAnnotation boundingBox + * @property {number|null} [score] ImageObjectDetectionAnnotation score + */ + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionAnnotation. + * @implements IImageObjectDetectionAnnotation + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + */ + function ImageObjectDetectionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionAnnotation boundingBox. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.boundingBox = null; + + /** + * ImageObjectDetectionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.score = 0; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation instance + */ + ImageObjectDetectionAnnotation.create = function create(properties) { + return new ImageObjectDetectionAnnotation(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + case 2: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + */ + ImageObjectDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingBox = null; + object.score = 0; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageObjectDetectionAnnotation; + })(); + + v1.BoundingBoxMetricsEntry = (function() { + + /** + * Properties of a BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @interface IBoundingBoxMetricsEntry + * @property {number|null} [iouThreshold] BoundingBoxMetricsEntry iouThreshold + * @property {number|null} [meanAveragePrecision] BoundingBoxMetricsEntry meanAveragePrecision + * @property {Array.|null} [confidenceMetricsEntries] BoundingBoxMetricsEntry confidenceMetricsEntries + */ + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingBoxMetricsEntry. + * @implements IBoundingBoxMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + */ + function BoundingBoxMetricsEntry(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBoxMetricsEntry iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.iouThreshold = 0; + + /** + * BoundingBoxMetricsEntry meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.meanAveragePrecision = 0; + + /** + * BoundingBoxMetricsEntry confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry instance + */ + BoundingBoxMetricsEntry.create = function create(properties) { + return new BoundingBoxMetricsEntry(properties); + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.iouThreshold); + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAveragePrecision); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iouThreshold = reader.float(); + break; + case 2: + message.meanAveragePrecision = reader.float(); + break; + case 3: + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + if (typeof message.iouThreshold !== "number") + return "iouThreshold: number expected"; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + */ + BoundingBoxMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry} message BoundingBoxMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.iouThreshold = 0; + object.meanAveragePrecision = 0; + } + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BoundingBoxMetricsEntry.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && message.hasOwnProperty("recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && message.hasOwnProperty("precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confidenceThreshold = reader.float(); + break; + case 2: + message.recall = reader.float(); + break; + case 3: + message.precision = reader.float(); + break; + case 4: + message.f1Score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConfidenceMetricsEntry; + })(); + + return BoundingBoxMetricsEntry; + })(); + + v1.ImageObjectDetectionEvaluationMetrics = (function() { + + /** + * Properties of an ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionEvaluationMetrics + * @property {number|null} [evaluatedBoundingBoxCount] ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionEvaluationMetrics. + * @implements IImageObjectDetectionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + */ + function ImageObjectDetectionEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics instance + */ + ImageObjectDetectionEvaluationMetrics.create = function create(properties) { + return new ImageObjectDetectionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evaluatedBoundingBoxCount = reader.int32(); + break; + case 2: + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + case 3: + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + */ + ImageObjectDetectionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageObjectDetectionEvaluationMetrics; + })(); + + v1.TextExtractionAnnotation = (function() { + + /** + * Properties of a TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionAnnotation + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] TextExtractionAnnotation textSegment + * @property {number|null} [score] TextExtractionAnnotation score + */ + + /** + * Constructs a new TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionAnnotation. + * @implements ITextExtractionAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + */ + function TextExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionAnnotation textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.textSegment = null; + + /** + * TextExtractionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.score = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextExtractionAnnotation annotation. + * @member {"textSegment"|undefined} annotation + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + Object.defineProperty(TextExtractionAnnotation.prototype, "annotation", { + get: $util.oneOfGetter($oneOfFields = ["textSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation instance + */ + TextExtractionAnnotation.create = function create(properties) { + return new TextExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && message.hasOwnProperty("score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + case 1: + message.score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + properties.annotation = 1; + { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + */ + TextExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionAnnotation.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.TextExtractionAnnotation} message TextExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (options.oneofs) + object.annotation = "textSegment"; + } + return object; + }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextExtractionAnnotation; + })(); + + v1.TextExtractionEvaluationMetrics = (function() { + + /** + * Properties of a TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionEvaluationMetrics + * @property {number|null} [auPrc] TextExtractionEvaluationMetrics auPrc + * @property {Array.|null} [confidenceMetricsEntries] TextExtractionEvaluationMetrics confidenceMetricsEntries + */ + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionEvaluationMetrics. + * @implements ITextExtractionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + */ + function TextExtractionEvaluationMetrics(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.auPrc = 0; + + /** + * TextExtractionEvaluationMetrics confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics instance + */ + TextExtractionEvaluationMetrics.create = function create(properties) { + return new TextExtractionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.auPrc = reader.float(); + break; + case 2: + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + */ + TextExtractionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) + object.auPrc = 0; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextExtractionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TextExtractionEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && message.hasOwnProperty("recall")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.recall); + if (message.precision != null && message.hasOwnProperty("precision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.precision); + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confidenceThreshold = reader.float(); + break; + case 3: + message.recall = reader.float(); + break; + case 4: + message.precision = reader.float(); + break; + case 5: + message.f1Score = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConfidenceMetricsEntry; + })(); + + return TextExtractionEvaluationMetrics; + })(); + + v1.TextSentimentAnnotation = (function() { + + /** + * Properties of a TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentAnnotation + * @property {number|null} [sentiment] TextSentimentAnnotation sentiment + */ + + /** + * Constructs a new TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentAnnotation. + * @implements ITextSentimentAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + */ + function TextSentimentAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentAnnotation sentiment. + * @member {number} sentiment + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + */ + TextSentimentAnnotation.prototype.sentiment = 0; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation instance + */ + TextSentimentAnnotation.create = function create(properties) { + return new TextSentimentAnnotation(properties); + }; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentiment); + return writer; + }; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sentiment = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + if (!$util.isInteger(message.sentiment)) + return "sentiment: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + */ + TextSentimentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + if (object.sentiment != null) + message.sentiment = object.sentiment | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.TextSentimentAnnotation} message TextSentimentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentiment = 0; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = message.sentiment; + return object; + }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextSentimentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSentimentAnnotation; + })(); + + v1.TextSentimentEvaluationMetrics = (function() { + + /** + * Properties of a TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentEvaluationMetrics + * @property {number|null} [precision] TextSentimentEvaluationMetrics precision + * @property {number|null} [recall] TextSentimentEvaluationMetrics recall + * @property {number|null} [f1Score] TextSentimentEvaluationMetrics f1Score + * @property {number|null} [meanAbsoluteError] TextSentimentEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanSquaredError] TextSentimentEvaluationMetrics meanSquaredError + * @property {number|null} [linearKappa] TextSentimentEvaluationMetrics linearKappa + * @property {number|null} [quadraticKappa] TextSentimentEvaluationMetrics quadraticKappa + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] TextSentimentEvaluationMetrics confusionMatrix + */ + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentEvaluationMetrics. + * @implements ITextSentimentEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + */ + function TextSentimentEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentEvaluationMetrics precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.precision = 0; + + /** + * TextSentimentEvaluationMetrics recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.recall = 0; + + /** + * TextSentimentEvaluationMetrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.f1Score = 0; + + /** + * TextSentimentEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * TextSentimentEvaluationMetrics meanSquaredError. + * @member {number} meanSquaredError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanSquaredError = 0; + + /** + * TextSentimentEvaluationMetrics linearKappa. + * @member {number} linearKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.linearKappa = 0; + + /** + * TextSentimentEvaluationMetrics quadraticKappa. + * @member {number} quadraticKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.quadraticKappa = 0; + + /** + * TextSentimentEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics instance + */ + TextSentimentEvaluationMetrics.create = function create(properties) { + return new TextSentimentEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && message.hasOwnProperty("precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && message.hasOwnProperty("recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAbsoluteError); + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.meanSquaredError); + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.linearKappa); + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.quadraticKappa); + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.precision = reader.float(); + break; + case 2: + message.recall = reader.float(); + break; + case 3: + message.f1Score = reader.float(); + break; + case 4: + message.meanAbsoluteError = reader.float(); + break; + case 5: + message.meanSquaredError = reader.float(); + break; + case 6: + message.linearKappa = reader.float(); + break; + case 7: + message.quadraticKappa = reader.float(); + break; + case 8: + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + if (typeof message.meanSquaredError !== "number") + return "meanSquaredError: number expected"; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + if (typeof message.linearKappa !== "number") + return "linearKappa: number expected"; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + if (typeof message.quadraticKappa !== "number") + return "quadraticKappa: number expected"; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + return null; + }; + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + */ + TextSentimentEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanSquaredError != null) + message.meanSquaredError = Number(object.meanSquaredError); + if (object.linearKappa != null) + message.linearKappa = Number(object.linearKappa); + if (object.quadraticKappa != null) + message.quadraticKappa = Number(object.quadraticKappa); + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.TextSentimentEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + return message; + }; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.meanAbsoluteError = 0; + object.meanSquaredError = 0; + object.linearKappa = 0; + object.quadraticKappa = 0; + object.confusionMatrix = null; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + object.meanSquaredError = options.json && !isFinite(message.meanSquaredError) ? String(message.meanSquaredError) : message.meanSquaredError; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + object.linearKappa = options.json && !isFinite(message.linearKappa) ? String(message.linearKappa) : message.linearKappa; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + object.quadraticKappa = options.json && !isFinite(message.quadraticKappa) ? String(message.quadraticKappa) : message.quadraticKappa; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + return object; + }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextSentimentEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextSentimentEvaluationMetrics; + })(); + + v1.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictionService + * @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 PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.PredictionService + * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService#predict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.automl.v1.PredictRequest, $root.google.cloud.automl.v1.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService#batchPredict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef BatchPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.BatchPredictCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.batchPredict = function batchPredict(request, callback) { + return this.rpcCall(batchPredict, $root.google.cloud.automl.v1.BatchPredictRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchPredict" }); + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IPredictRequest + * @property {string|null} [name] PredictRequest name + * @property {google.cloud.automl.v1.IExamplePayload|null} [payload] PredictRequest payload + * @property {Object.|null} [params] PredictRequest params + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.name = ""; + + /** + * PredictRequest payload. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} payload + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.payload = null; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.payload != null && message.hasOwnProperty("payload")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && message.hasOwnProperty("params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.payload = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + case 3: + reader.skip().pos++; + if (message.params === $util.emptyObject) + message.params = {}; + key = reader.string(); + reader.pos++; + message.params[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.PredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.payload: object expected"); + message.payload = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.payload); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.payload, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PredictRequest; + })(); + + v1.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.cloud.automl.v1 + * @interface IPredictResponse + * @property {Array.|null} [payload] PredictResponse payload + * @property {google.cloud.automl.v1.IExamplePayload|null} [preprocessedInput] PredictResponse preprocessedInput + * @property {Object.|null} [metadata] PredictResponse metadata + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.payload = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse payload. + * @member {Array.} payload + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.payload = $util.emptyArray; + + /** + * PredictResponse preprocessedInput. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} preprocessedInput + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.preprocessedInput = null; + + /** + * PredictResponse metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && message.payload.length) + for (var i = 0; i < message.payload.length; ++i) + $root.google.cloud.automl.v1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && message.hasOwnProperty("metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.preprocessedInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictResponse(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.payload && message.payload.length)) + message.payload = []; + message.payload.push($root.google.cloud.automl.v1.AnnotationPayload.decode(reader, reader.uint32())); + break; + case 3: + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + case 2: + reader.skip().pos++; + if (message.metadata === $util.emptyObject) + message.metadata = {}; + key = reader.string(); + reader.pos++; + message.metadata[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + if (!Array.isArray(message.payload)) + return "payload: array expected"; + for (var i = 0; i < message.payload.length; ++i) { + var error = $root.google.cloud.automl.v1.AnnotationPayload.verify(message.payload[i]); + if (error) + return "payload." + error; + } + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.preprocessedInput); + if (error) + return "preprocessedInput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictResponse) + return object; + var message = new $root.google.cloud.automl.v1.PredictResponse(); + if (object.payload) { + if (!Array.isArray(object.payload)) + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: array expected"); + message.payload = []; + for (var i = 0; i < object.payload.length; ++i) { + if (typeof object.payload[i] !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: object expected"); + message.payload[i] = $root.google.cloud.automl.v1.AnnotationPayload.fromObject(object.payload[i]); + } + } + if (object.preprocessedInput != null) { + if (typeof object.preprocessedInput !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.preprocessedInput: object expected"); + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.preprocessedInput); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payload = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.preprocessedInput = null; + if (message.payload && message.payload.length) { + object.payload = []; + for (var j = 0; j < message.payload.length; ++j) + object.payload[j] = $root.google.cloud.automl.v1.AnnotationPayload.toObject(message.payload[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + object.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.preprocessedInput, options); + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PredictResponse; + })(); + + v1.BatchPredictRequest = (function() { + + /** + * Properties of a BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictRequest + * @property {string|null} [name] BatchPredictRequest name + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictRequest inputConfig + * @property {google.cloud.automl.v1.IBatchPredictOutputConfig|null} [outputConfig] BatchPredictRequest outputConfig + * @property {Object.|null} [params] BatchPredictRequest params + */ + + /** + * Constructs a new BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictRequest. + * @implements IBatchPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + */ + function BatchPredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.name = ""; + + /** + * BatchPredictRequest inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.inputConfig = null; + + /** + * BatchPredictRequest outputConfig. + * @member {google.cloud.automl.v1.IBatchPredictOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.outputConfig = null; + + /** + * BatchPredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest instance + */ + BatchPredictRequest.create = function create(properties) { + return new BatchPredictRequest(properties); + }; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.automl.v1.BatchPredictOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && message.hasOwnProperty("params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictRequest(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + case 4: + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.decode(reader, reader.uint32()); + break; + case 5: + reader.skip().pos++; + if (message.params === $util.emptyObject) + message.params = {}; + key = reader.string(); + reader.pos++; + message.params[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + */ + BatchPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.fromObject(object.outputConfig); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.BatchPredictRequest} message BatchPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + * @returns {Object.} JSON object + */ + BatchPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchPredictRequest; + })(); + + v1.BatchPredictResult = (function() { + + /** + * Properties of a BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictResult + * @property {Object.|null} [metadata] BatchPredictResult metadata + */ + + /** + * Constructs a new BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictResult. + * @implements IBatchPredictResult + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + */ + function BatchPredictResult(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + */ + BatchPredictResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult instance + */ + BatchPredictResult.create = function create(properties) { + return new BatchPredictResult(properties); + }; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && message.hasOwnProperty("metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictResult(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.metadata === $util.emptyObject) + message.metadata = {}; + key = reader.string(); + reader.pos++; + message.metadata[key] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictResult message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + */ + BatchPredictResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictResult) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictResult(); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.BatchPredictResult} message BatchPredictResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictResult to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + * @returns {Object.} JSON object + */ + BatchPredictResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchPredictResult; + })(); + + v1.AnnotationPayload = (function() { + + /** + * Properties of an AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationPayload + * @property {google.cloud.automl.v1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @property {google.cloud.automl.v1.IClassificationAnnotation|null} [classification] AnnotationPayload classification + * @property {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null} [imageObjectDetection] AnnotationPayload imageObjectDetection + * @property {google.cloud.automl.v1.ITextExtractionAnnotation|null} [textExtraction] AnnotationPayload textExtraction + * @property {google.cloud.automl.v1.ITextSentimentAnnotation|null} [textSentiment] AnnotationPayload textSentiment + * @property {string|null} [annotationSpecId] AnnotationPayload annotationSpecId + * @property {string|null} [displayName] AnnotationPayload displayName + */ + + /** + * Constructs a new AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationPayload. + * @implements IAnnotationPayload + * @constructor + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + */ + function AnnotationPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationPayload translation. + * @member {google.cloud.automl.v1.ITranslationAnnotation|null|undefined} translation + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.translation = null; + + /** + * AnnotationPayload classification. + * @member {google.cloud.automl.v1.IClassificationAnnotation|null|undefined} classification + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.classification = null; + + /** + * AnnotationPayload imageObjectDetection. + * @member {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null|undefined} imageObjectDetection + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.imageObjectDetection = null; + + /** + * AnnotationPayload textExtraction. + * @member {google.cloud.automl.v1.ITextExtractionAnnotation|null|undefined} textExtraction + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textExtraction = null; + + /** + * AnnotationPayload textSentiment. + * @member {google.cloud.automl.v1.ITextSentimentAnnotation|null|undefined} textSentiment + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textSentiment = null; + + /** + * AnnotationPayload annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.annotationSpecId = ""; + + /** + * AnnotationPayload displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationPayload detail. + * @member {"translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"|undefined} detail + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + Object.defineProperty(AnnotationPayload.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["translation", "classification", "imageObjectDetection", "textExtraction", "textSentiment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload instance + */ + AnnotationPayload.create = function create(properties) { + return new AnnotationPayload(properties); + }; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId); + if (message.translation != null && message.hasOwnProperty("translation")) + $root.google.cloud.automl.v1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classification != null && message.hasOwnProperty("classification")) + $root.google.cloud.automl.v1.ClassificationAnnotation.encode(message.classification, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) + $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.encode(message.imageObjectDetection, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && message.hasOwnProperty("displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) + $root.google.cloud.automl.v1.TextExtractionAnnotation.encode(message.textExtraction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) + $root.google.cloud.automl.v1.TextSentimentAnnotation.encode(message.textSentiment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.decode(reader, reader.uint32()); + break; + case 3: + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + case 4: + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.decode(reader, reader.uint32()); + break; + case 6: + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.decode(reader, reader.uint32()); + break; + case 7: + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.decode(reader, reader.uint32()); + break; + case 1: + message.annotationSpecId = reader.string(); + break; + case 5: + message.displayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationPayload message. + * @function verify + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translation != null && message.hasOwnProperty("translation")) { + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TranslationAnnotation.verify(message.translation); + if (error) + return "translation." + error; + } + } + if (message.classification != null && message.hasOwnProperty("classification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationAnnotation.verify(message.classification); + if (error) + return "classification." + error; + } + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify(message.imageObjectDetection); + if (error) + return "imageObjectDetection." + error; + } + } + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionAnnotation.verify(message.textExtraction); + if (error) + return "textExtraction." + error; + } + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentAnnotation.verify(message.textSentiment); + if (error) + return "textSentiment." + error; + } + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + */ + AnnotationPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationPayload) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationPayload(); + if (object.translation != null) { + if (typeof object.translation !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.translation: object expected"); + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.fromObject(object.translation); + } + if (object.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.classification: object expected"); + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.fromObject(object.classification); + } + if (object.imageObjectDetection != null) { + if (typeof object.imageObjectDetection !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.imageObjectDetection: object expected"); + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.fromObject(object.imageObjectDetection); + } + if (object.textExtraction != null) { + if (typeof object.textExtraction !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textExtraction: object expected"); + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.fromObject(object.textExtraction); + } + if (object.textSentiment != null) { + if (typeof object.textSentiment !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textSentiment: object expected"); + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.fromObject(object.textSentiment); + } + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.AnnotationPayload} message AnnotationPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecId = ""; + object.displayName = ""; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.translation != null && message.hasOwnProperty("translation")) { + object.translation = $root.google.cloud.automl.v1.TranslationAnnotation.toObject(message.translation, options); + if (options.oneofs) + object.detail = "translation"; + } + if (message.classification != null && message.hasOwnProperty("classification")) { + object.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.toObject(message.classification, options); + if (options.oneofs) + object.detail = "classification"; + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + object.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.toObject(message.imageObjectDetection, options); + if (options.oneofs) + object.detail = "imageObjectDetection"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + object.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.toObject(message.textExtraction, options); + if (options.oneofs) + object.detail = "textExtraction"; + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + object.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.toObject(message.textSentiment, options); + if (options.oneofs) + object.detail = "textSentiment"; + } + return object; + }; + + /** + * Converts this AnnotationPayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + * @returns {Object.} JSON object + */ + AnnotationPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotationPayload; + })(); + + v1.AutoMl = (function() { + + /** + * Constructs a new AutoMl service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AutoMl + * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; + + /** + * Creates new AutoMl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.AutoMl + * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. + */ + AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#createDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.automl.v1.CreateDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.automl.v1.GetDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listDatasets}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.automl.v1.ListDatasetsRequest, $root.google.cloud.automl.v1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.automl.v1.UpdateDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#importData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.automl.v1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.automl.v1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getAnnotationSpec}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetAnnotationSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.AnnotationSpec} [response] AnnotationSpec + */ + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback} callback Node-style callback called with the error, if any, and AnnotationSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getAnnotationSpec = function getAnnotationSpec(request, callback) { + return this.rpcCall(getAnnotationSpec, $root.google.cloud.automl.v1.GetAnnotationSpecRequest, $root.google.cloud.automl.v1.AnnotationSpec, request, callback); + }, "name", { value: "GetAnnotationSpec" }); + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#createModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.automl.v1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.cloud.automl.v1.GetModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModels}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.cloud.automl.v1.ListModelsRequest, $root.google.cloud.automl.v1.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deleteModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.automl.v1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#updateModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateModel = function updateModel(request, callback) { + return this.rpcCall(updateModel, $root.google.cloud.automl.v1.UpdateModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "UpdateModel" }); + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl#deployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deployModel = function deployModel(request, callback) { + return this.rpcCall(deployModel, $root.google.cloud.automl.v1.DeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployModel" }); + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * ListModelEvaluationsRequest filter. - * @member {string} filter - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @instance + * Callback as used by {@link google.cloud.automl.v1.AutoMl#undeployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UndeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListModelEvaluationsRequest.prototype.filter = ""; /** - * ListModelEvaluationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UndeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListModelEvaluationsRequest.prototype.pageSize = 0; + Object.defineProperty(AutoMl.prototype.undeployModel = function undeployModel(request, callback) { + return this.rpcCall(undeployModel, $root.google.cloud.automl.v1.UndeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployModel" }); /** - * ListModelEvaluationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListModelEvaluationsRequest.prototype.pageToken = ""; /** - * Creates a new ListModelEvaluationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance + * Callback as used by {@link google.cloud.automl.v1.AutoMl#exportModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListModelEvaluationsRequest.create = function create(properties) { - return new ListModelEvaluationsRequest(properties); - }; /** - * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListModelEvaluationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && message.hasOwnProperty("filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - return writer; - }; + Object.defineProperty(AutoMl.prototype.exportModel = function exportModel(request, callback) { + return this.rpcCall(exportModel, $root.google.cloud.automl.v1.ExportModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportModel" }); /** - * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.automl.v1.AutoMl#getModelEvaluation}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ModelEvaluation} [response] ModelEvaluation */ - ListModelEvaluationsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 3: - message.filter = reader.string(); - break; - case 4: - message.pageSize = reader.int32(); - break; - case 6: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation + * @returns {undefined} + * @variation 1 */ - ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { + return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1.GetModelEvaluationRequest, $root.google.cloud.automl.v1.ModelEvaluation, request, callback); + }, "name", { value: "GetModelEvaluation" }); /** - * Verifies a ListModelEvaluationsRequest message. - * @function verify - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListModelEvaluationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: 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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * Callback as used by {@link google.cloud.automl.v1.AutoMl#listModelEvaluations}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse */ - ListModelEvaluationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsRequest) - return object; - var message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - 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 ListModelEvaluationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest - * @static - * @param {google.cloud.automl.v1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * @returns {undefined} + * @variation 1 */ - ListModelEvaluationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; + Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { + return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1.ListModelEvaluationsResponse, request, callback); + }, "name", { value: "ListModelEvaluations" }); /** - * Converts this ListModelEvaluationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl * @instance - * @returns {Object.} JSON object + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return ListModelEvaluationsRequest; + return AutoMl; })(); - v1.ListModelEvaluationsResponse = (function() { + v1.CreateDatasetRequest = (function() { /** - * Properties of a ListModelEvaluationsResponse. + * Properties of a CreateDatasetRequest. * @memberof google.cloud.automl.v1 - * @interface IListModelEvaluationsResponse - * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation - * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.automl.v1.IDataset|null} [dataset] CreateDatasetRequest dataset */ /** - * Constructs a new ListModelEvaluationsResponse. + * Constructs a new CreateDatasetRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ListModelEvaluationsResponse. - * @implements IListModelEvaluationsResponse + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest * @constructor - * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set */ - function ListModelEvaluationsResponse(properties) { - this.modelEvaluation = []; + function CreateDatasetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4035,91 +18177,88 @@ } /** - * ListModelEvaluationsResponse modelEvaluation. - * @member {Array.} modelEvaluation - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * CreateDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @instance */ - ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; + CreateDatasetRequest.prototype.parent = ""; /** - * ListModelEvaluationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * CreateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @instance */ - ListModelEvaluationsResponse.prototype.nextPageToken = ""; + CreateDatasetRequest.prototype.dataset = null; /** - * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * Creates a new CreateDatasetRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest instance */ - ListModelEvaluationsResponse.create = function create(properties) { - return new ListModelEvaluationsResponse(properties); + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); }; /** - * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelEvaluationsResponse.encode = function encode(message, writer) { + CreateDatasetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.modelEvaluation != null && message.modelEvaluation.length) - for (var i = 0; i < message.modelEvaluation.length; ++i) - $root.google.cloud.automl.v1.ModelEvaluation.encode(message.modelEvaluation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.dataset != null && message.hasOwnProperty("dataset")) + $root.google.cloud.automl.v1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static - * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * Decodes a CreateDatasetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelEvaluationsResponse.decode = function decode(reader, length) { + CreateDatasetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.modelEvaluation && message.modelEvaluation.length)) - message.modelEvaluation = []; - message.modelEvaluation.push($root.google.cloud.automl.v1.ModelEvaluation.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.dataset = $root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4130,133 +18269,121 @@ }; /** - * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelEvaluationsResponse message. + * Verifies a CreateDatasetRequest message. * @function verify - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListModelEvaluationsResponse.verify = function verify(message) { + CreateDatasetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { - if (!Array.isArray(message.modelEvaluation)) - return "modelEvaluation: array expected"; - for (var i = 0; i < message.modelEvaluation.length; ++i) { - var error = $root.google.cloud.automl.v1.ModelEvaluation.verify(message.modelEvaluation[i]); - if (error) - return "modelEvaluation." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest */ - ListModelEvaluationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsResponse) + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetRequest) return object; - var message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); - if (object.modelEvaluation) { - if (!Array.isArray(object.modelEvaluation)) - throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: array expected"); - message.modelEvaluation = []; - for (var i = 0; i < object.modelEvaluation.length; ++i) { - if (typeof object.modelEvaluation[i] !== "object") - throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: object expected"); - message.modelEvaluation[i] = $root.google.cloud.automl.v1.ModelEvaluation.fromObject(object.modelEvaluation[i]); - } + var message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @static - * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse + * @param {google.cloud.automl.v1.CreateDatasetRequest} message CreateDatasetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelEvaluationsResponse.toObject = function toObject(message, options) { + CreateDatasetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.modelEvaluation = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.modelEvaluation && message.modelEvaluation.length) { - object.modelEvaluation = []; - for (var j = 0; j < message.modelEvaluation.length; ++j) - object.modelEvaluation[j] = $root.google.cloud.automl.v1.ModelEvaluation.toObject(message.modelEvaluation[j], options); + if (options.defaults) { + object.parent = ""; + object.dataset = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); return object; }; /** - * Converts this ListModelEvaluationsResponse to JSON. + * Converts this CreateDatasetRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @memberof google.cloud.automl.v1.CreateDatasetRequest * @instance * @returns {Object.} JSON object */ - ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { + CreateDatasetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListModelEvaluationsResponse; + return CreateDatasetRequest; })(); - v1.AnnotationPayload = (function() { + v1.GetDatasetRequest = (function() { /** - * Properties of an AnnotationPayload. + * Properties of a GetDatasetRequest. * @memberof google.cloud.automl.v1 - * @interface IAnnotationPayload - * @property {google.cloud.automl.v1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name */ /** - * Constructs a new AnnotationPayload. + * Constructs a new GetDatasetRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents an AnnotationPayload. - * @implements IAnnotationPayload + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest * @constructor - * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set */ - function AnnotationPayload(properties) { + function GetDatasetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4264,89 +18391,75 @@ } /** - * AnnotationPayload translation. - * @member {google.cloud.automl.v1.ITranslationAnnotation|null|undefined} translation - * @memberof google.cloud.automl.v1.AnnotationPayload - * @instance - */ - AnnotationPayload.prototype.translation = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AnnotationPayload detail. - * @member {"translation"|undefined} detail - * @memberof google.cloud.automl.v1.AnnotationPayload + * GetDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetDatasetRequest * @instance */ - Object.defineProperty(AnnotationPayload.prototype, "detail", { - get: $util.oneOfGetter($oneOfFields = ["translation"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetDatasetRequest.prototype.name = ""; /** - * Creates a new AnnotationPayload instance using the specified properties. + * Creates a new GetDatasetRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static - * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set - * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload instance + * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest instance */ - AnnotationPayload.create = function create(properties) { - return new AnnotationPayload(properties); + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); }; /** - * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static - * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotationPayload.encode = function encode(message, writer) { + GetDatasetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translation != null && message.hasOwnProperty("translation")) - $root.google.cloud.automl.v1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static - * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AnnotationPayload message from the specified reader or buffer. + * Decodes a GetDatasetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotationPayload.decode = function decode(reader, length) { + GetDatasetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationPayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetDatasetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.decode(reader, reader.uint32()); + case 1: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -4357,118 +18470,110 @@ }; /** - * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AnnotationPayload message. + * Verifies a GetDatasetRequest message. * @function verify - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AnnotationPayload.verify = function verify(message) { + GetDatasetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.translation != null && message.hasOwnProperty("translation")) { - properties.detail = 1; - { - var error = $root.google.cloud.automl.v1.TranslationAnnotation.verify(message.translation); - if (error) - return "translation." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest */ - AnnotationPayload.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.AnnotationPayload) + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetDatasetRequest) return object; - var message = new $root.google.cloud.automl.v1.AnnotationPayload(); - if (object.translation != null) { - if (typeof object.translation !== "object") - throw TypeError(".google.cloud.automl.v1.AnnotationPayload.translation: object expected"); - message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.fromObject(object.translation); - } + var message = new $root.google.cloud.automl.v1.GetDatasetRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @static - * @param {google.cloud.automl.v1.AnnotationPayload} message AnnotationPayload + * @param {google.cloud.automl.v1.GetDatasetRequest} message GetDatasetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AnnotationPayload.toObject = function toObject(message, options) { + GetDatasetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.translation != null && message.hasOwnProperty("translation")) { - object.translation = $root.google.cloud.automl.v1.TranslationAnnotation.toObject(message.translation, options); - if (options.oneofs) - object.detail = "translation"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this AnnotationPayload to JSON. + * Converts this GetDatasetRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.AnnotationPayload + * @memberof google.cloud.automl.v1.GetDatasetRequest * @instance * @returns {Object.} JSON object */ - AnnotationPayload.prototype.toJSON = function toJSON() { + GetDatasetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AnnotationPayload; + return GetDatasetRequest; })(); - v1.TranslationDatasetMetadata = (function() { + v1.ListDatasetsRequest = (function() { /** - * Properties of a TranslationDatasetMetadata. + * Properties of a ListDatasetsRequest. * @memberof google.cloud.automl.v1 - * @interface ITranslationDatasetMetadata - * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode - * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + * @interface IListDatasetsRequest + * @property {string|null} [parent] ListDatasetsRequest parent + * @property {string|null} [filter] ListDatasetsRequest filter + * @property {number|null} [pageSize] ListDatasetsRequest pageSize + * @property {string|null} [pageToken] ListDatasetsRequest pageToken */ /** - * Constructs a new TranslationDatasetMetadata. + * Constructs a new ListDatasetsRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a TranslationDatasetMetadata. - * @implements ITranslationDatasetMetadata + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest * @constructor - * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set */ - function TranslationDatasetMetadata(properties) { + function ListDatasetsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4476,88 +18581,114 @@ } /** - * TranslationDatasetMetadata sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * ListDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @instance */ - TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + ListDatasetsRequest.prototype.parent = ""; /** - * TranslationDatasetMetadata targetLanguageCode. - * @member {string} targetLanguageCode - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @instance */ - TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + ListDatasetsRequest.prototype.filter = ""; /** - * Creates a new TranslationDatasetMetadata instance using the specified properties. + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static - * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set - * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest instance */ - TranslationDatasetMetadata.create = function create(properties) { - return new TranslationDatasetMetadata(properties); + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); }; /** - * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static - * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationDatasetMetadata.encode = function encode(message, writer) { + ListDatasetsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); return writer; }; /** - * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static - * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * Decodes a ListDatasetsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationDatasetMetadata.decode = function decode(reader, length) { + ListDatasetsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sourceLanguageCode = reader.string(); + message.parent = reader.string(); break; - case 2: - message.targetLanguageCode = reader.string(); + case 3: + message.filter = reader.string(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4568,117 +18699,134 @@ }; /** - * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TranslationDatasetMetadata message. + * Verifies a ListDatasetsRequest message. * @function verify - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TranslationDatasetMetadata.verify = function verify(message) { + ListDatasetsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - if (!$util.isString(message.targetLanguageCode)) - return "targetLanguageCode: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest */ - TranslationDatasetMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.TranslationDatasetMetadata) + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsRequest) return object; - var message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCode != null) - message.targetLanguageCode = String(object.targetLanguageCode); + var message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + 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 TranslationDatasetMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @static - * @param {google.cloud.automl.v1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {google.cloud.automl.v1.ListDatasetsRequest} message ListDatasetsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TranslationDatasetMetadata.toObject = function toObject(message, options) { + ListDatasetsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.sourceLanguageCode = ""; - object.targetLanguageCode = ""; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - object.targetLanguageCode = message.targetLanguageCode; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + 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 TranslationDatasetMetadata to JSON. + * Converts this ListDatasetsRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @memberof google.cloud.automl.v1.ListDatasetsRequest * @instance * @returns {Object.} JSON object */ - TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + ListDatasetsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TranslationDatasetMetadata; + return ListDatasetsRequest; })(); - v1.TranslationEvaluationMetrics = (function() { + v1.ListDatasetsResponse = (function() { /** - * Properties of a TranslationEvaluationMetrics. + * Properties of a ListDatasetsResponse. * @memberof google.cloud.automl.v1 - * @interface ITranslationEvaluationMetrics - * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore - * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken */ /** - * Constructs a new TranslationEvaluationMetrics. + * Constructs a new ListDatasetsResponse. * @memberof google.cloud.automl.v1 - * @classdesc Represents a TranslationEvaluationMetrics. - * @implements ITranslationEvaluationMetrics + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse * @constructor - * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set */ - function TranslationEvaluationMetrics(properties) { + function ListDatasetsResponse(properties) { + this.datasets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4686,88 +18834,91 @@ } /** - * TranslationEvaluationMetrics bleuScore. - * @member {number} bleuScore - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * ListDatasetsResponse datasets. + * @member {Array.} datasets + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @instance */ - TranslationEvaluationMetrics.prototype.bleuScore = 0; + ListDatasetsResponse.prototype.datasets = $util.emptyArray; /** - * TranslationEvaluationMetrics baseBleuScore. - * @member {number} baseBleuScore - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @instance */ - TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + ListDatasetsResponse.prototype.nextPageToken = ""; /** - * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * Creates a new ListDatasetsResponse instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static - * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set - * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse instance */ - TranslationEvaluationMetrics.create = function create(properties) { - return new TranslationEvaluationMetrics(properties); + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); }; /** - * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static - * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationEvaluationMetrics.encode = function encode(message, writer) { + ListDatasetsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); - if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.automl.v1.Dataset.encode(message.datasets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static - * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * Decodes a ListDatasetsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationEvaluationMetrics.decode = function decode(reader, length) { + ListDatasetsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bleuScore = reader.double(); + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32())); break; case 2: - message.baseBleuScore = reader.double(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4778,220 +18929,223 @@ }; /** - * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TranslationEvaluationMetrics message. + * Verifies a ListDatasetsResponse message. * @function verify - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TranslationEvaluationMetrics.verify = function verify(message) { + ListDatasetsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) - if (typeof message.bleuScore !== "number") - return "bleuScore: number expected"; - if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) - if (typeof message.baseBleuScore !== "number") - return "baseBleuScore: number expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse */ - TranslationEvaluationMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.TranslationEvaluationMetrics) + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsResponse) return object; - var message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); - if (object.bleuScore != null) - message.bleuScore = Number(object.bleuScore); - if (object.baseBleuScore != null) - message.baseBleuScore = Number(object.baseBleuScore); + var message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.automl.v1.Dataset.fromObject(object.datasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @static - * @param {google.cloud.automl.v1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {google.cloud.automl.v1.ListDatasetsResponse} message ListDatasetsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TranslationEvaluationMetrics.toObject = function toObject(message, options) { + ListDatasetsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.bleuScore = 0; - object.baseBleuScore = 0; + if (options.arrays || options.defaults) + object.datasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.automl.v1.Dataset.toObject(message.datasets[j], options); } - if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) - object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; - if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) - object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this TranslationEvaluationMetrics to JSON. + * Converts this ListDatasetsResponse to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @memberof google.cloud.automl.v1.ListDatasetsResponse * @instance * @returns {Object.} JSON object */ - TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + ListDatasetsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TranslationEvaluationMetrics; + return ListDatasetsResponse; })(); - v1.TranslationModelMetadata = (function() { + v1.UpdateDatasetRequest = (function() { /** - * Properties of a TranslationModelMetadata. + * Properties of an UpdateDatasetRequest. * @memberof google.cloud.automl.v1 - * @interface ITranslationModelMetadata - * @property {string|null} [baseModel] TranslationModelMetadata baseModel - * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode - * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + * @interface IUpdateDatasetRequest + * @property {google.cloud.automl.v1.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask */ /** - * Constructs a new TranslationModelMetadata. + * Constructs a new UpdateDatasetRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a TranslationModelMetadata. - * @implements ITranslationModelMetadata + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest * @constructor - * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set - */ - function TranslationModelMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TranslationModelMetadata baseModel. - * @member {string} baseModel - * @memberof google.cloud.automl.v1.TranslationModelMetadata - * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set */ - TranslationModelMetadata.prototype.baseModel = ""; + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * TranslationModelMetadata sourceLanguageCode. - * @member {string} sourceLanguageCode - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * UpdateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @instance */ - TranslationModelMetadata.prototype.sourceLanguageCode = ""; + UpdateDatasetRequest.prototype.dataset = null; /** - * TranslationModelMetadata targetLanguageCode. - * @member {string} targetLanguageCode - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @instance */ - TranslationModelMetadata.prototype.targetLanguageCode = ""; + UpdateDatasetRequest.prototype.updateMask = null; /** - * Creates a new TranslationModelMetadata instance using the specified properties. + * Creates a new UpdateDatasetRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set - * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest instance */ - TranslationModelMetadata.create = function create(properties) { - return new TranslationModelMetadata(properties); + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); }; /** - * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationModelMetadata.encode = function encode(message, writer) { + UpdateDatasetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.baseModel != null && message.hasOwnProperty("baseModel")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + if (message.dataset != null && message.hasOwnProperty("dataset")) + $root.google.cloud.automl.v1.Dataset.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationModelMetadata.decode = function decode(reader, length) { + UpdateDatasetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.baseModel = reader.string(); + message.dataset = $root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32()); break; case 2: - message.sourceLanguageCode = reader.string(); - break; - case 3: - message.targetLanguageCode = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5002,124 +19156,126 @@ }; /** - * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TranslationModelMetadata message. + * Verifies an UpdateDatasetRequest message. * @function verify - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TranslationModelMetadata.verify = function verify(message) { + UpdateDatasetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.baseModel != null && message.hasOwnProperty("baseModel")) - if (!$util.isString(message.baseModel)) - return "baseModel: string expected"; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - if (!$util.isString(message.sourceLanguageCode)) - return "sourceLanguageCode: string expected"; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - if (!$util.isString(message.targetLanguageCode)) - return "targetLanguageCode: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest */ - TranslationModelMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.TranslationModelMetadata) + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateDatasetRequest) return object; - var message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); - if (object.baseModel != null) - message.baseModel = String(object.baseModel); - if (object.sourceLanguageCode != null) - message.sourceLanguageCode = String(object.sourceLanguageCode); - if (object.targetLanguageCode != null) - message.targetLanguageCode = String(object.targetLanguageCode); + var message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @static - * @param {google.cloud.automl.v1.TranslationModelMetadata} message TranslationModelMetadata + * @param {google.cloud.automl.v1.UpdateDatasetRequest} message UpdateDatasetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TranslationModelMetadata.toObject = function toObject(message, options) { + UpdateDatasetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.baseModel = ""; - object.sourceLanguageCode = ""; - object.targetLanguageCode = ""; + object.dataset = null; + object.updateMask = null; } - if (message.baseModel != null && message.hasOwnProperty("baseModel")) - object.baseModel = message.baseModel; - if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) - object.sourceLanguageCode = message.sourceLanguageCode; - if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) - object.targetLanguageCode = message.targetLanguageCode; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this TranslationModelMetadata to JSON. + * Converts this UpdateDatasetRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @memberof google.cloud.automl.v1.UpdateDatasetRequest * @instance * @returns {Object.} JSON object */ - TranslationModelMetadata.prototype.toJSON = function toJSON() { + UpdateDatasetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TranslationModelMetadata; + return UpdateDatasetRequest; })(); - v1.TranslationAnnotation = (function() { + v1.DeleteDatasetRequest = (function() { /** - * Properties of a TranslationAnnotation. + * Properties of a DeleteDatasetRequest. * @memberof google.cloud.automl.v1 - * @interface ITranslationAnnotation - * @property {google.cloud.automl.v1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name */ /** - * Constructs a new TranslationAnnotation. + * Constructs a new DeleteDatasetRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a TranslationAnnotation. - * @implements ITranslationAnnotation + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest * @constructor - * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set */ - function TranslationAnnotation(properties) { + function DeleteDatasetRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5127,75 +19283,75 @@ } /** - * TranslationAnnotation translatedContent. - * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} translatedContent - * @memberof google.cloud.automl.v1.TranslationAnnotation + * DeleteDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @instance */ - TranslationAnnotation.prototype.translatedContent = null; + DeleteDatasetRequest.prototype.name = ""; /** - * Creates a new TranslationAnnotation instance using the specified properties. + * Creates a new DeleteDatasetRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set - * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest instance */ - TranslationAnnotation.create = function create(properties) { - return new TranslationAnnotation(properties); + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); }; /** - * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationAnnotation.encode = function encode(message, writer) { + DeleteDatasetRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) - $root.google.cloud.automl.v1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static - * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TranslationAnnotation message from the specified reader or buffer. + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationAnnotation.decode = function decode(reader, length) { + DeleteDatasetRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -5206,114 +19362,108 @@ }; /** - * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TranslationAnnotation message. + * Verifies a DeleteDatasetRequest message. * @function verify - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TranslationAnnotation.verify = function verify(message) { + DeleteDatasetRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { - var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.translatedContent); - if (error) - return "translatedContent." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest */ - TranslationAnnotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.TranslationAnnotation) + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteDatasetRequest) return object; - var message = new $root.google.cloud.automl.v1.TranslationAnnotation(); - if (object.translatedContent != null) { - if (typeof object.translatedContent !== "object") - throw TypeError(".google.cloud.automl.v1.TranslationAnnotation.translatedContent: object expected"); - message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.translatedContent); - } + var message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @static - * @param {google.cloud.automl.v1.TranslationAnnotation} message TranslationAnnotation + * @param {google.cloud.automl.v1.DeleteDatasetRequest} message DeleteDatasetRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TranslationAnnotation.toObject = function toObject(message, options) { + DeleteDatasetRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.translatedContent = null; - if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) - object.translatedContent = $root.google.cloud.automl.v1.TextSnippet.toObject(message.translatedContent, options); + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TranslationAnnotation to JSON. + * Converts this DeleteDatasetRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.TranslationAnnotation + * @memberof google.cloud.automl.v1.DeleteDatasetRequest * @instance * @returns {Object.} JSON object */ - TranslationAnnotation.prototype.toJSON = function toJSON() { + DeleteDatasetRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TranslationAnnotation; + return DeleteDatasetRequest; })(); - v1.TextSnippet = (function() { + v1.ImportDataRequest = (function() { /** - * Properties of a TextSnippet. + * Properties of an ImportDataRequest. * @memberof google.cloud.automl.v1 - * @interface ITextSnippet - * @property {string|null} [content] TextSnippet content - * @property {string|null} [mimeType] TextSnippet mimeType - * @property {string|null} [contentUri] TextSnippet contentUri + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.automl.v1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig */ /** - * Constructs a new TextSnippet. + * Constructs a new ImportDataRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a TextSnippet. - * @implements ITextSnippet + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest * @constructor - * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set */ - function TextSnippet(properties) { + function ImportDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5321,101 +19471,88 @@ } /** - * TextSnippet content. - * @member {string} content - * @memberof google.cloud.automl.v1.TextSnippet - * @instance - */ - TextSnippet.prototype.content = ""; - - /** - * TextSnippet mimeType. - * @member {string} mimeType - * @memberof google.cloud.automl.v1.TextSnippet + * ImportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ImportDataRequest * @instance */ - TextSnippet.prototype.mimeType = ""; + ImportDataRequest.prototype.name = ""; /** - * TextSnippet contentUri. - * @member {string} contentUri - * @memberof google.cloud.automl.v1.TextSnippet + * ImportDataRequest inputConfig. + * @member {google.cloud.automl.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.ImportDataRequest * @instance */ - TextSnippet.prototype.contentUri = ""; + ImportDataRequest.prototype.inputConfig = null; /** - * Creates a new TextSnippet instance using the specified properties. + * Creates a new ImportDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static - * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set - * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet instance + * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest instance */ - TextSnippet.create = function create(properties) { - return new TextSnippet(properties); + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); }; /** - * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static - * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextSnippet.encode = function encode(message, writer) { + ImportDataRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && message.hasOwnProperty("content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - if (message.contentUri != null && message.hasOwnProperty("contentUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + $root.google.cloud.automl.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static - * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TextSnippet message from the specified reader or buffer. + * Decodes an ImportDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextSnippet.decode = function decode(reader, length) { + ImportDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSnippet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImportDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = reader.string(); - break; - case 2: - message.mimeType = reader.string(); + message.name = reader.string(); break; - case 4: - message.contentUri = reader.string(); + case 3: + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5426,124 +19563,122 @@ }; /** - * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextSnippet.decodeDelimited = function decodeDelimited(reader) { + ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TextSnippet message. + * Verifies an ImportDataRequest message. * @function verify - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TextSnippet.verify = function verify(message) { + ImportDataRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.contentUri != null && message.hasOwnProperty("contentUri")) - if (!$util.isString(message.contentUri)) - return "contentUri: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } return null; }; /** - * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest */ - TextSnippet.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.TextSnippet) + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataRequest) return object; - var message = new $root.google.cloud.automl.v1.TextSnippet(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.contentUri != null) - message.contentUri = String(object.contentUri); + var message = new $root.google.cloud.automl.v1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.fromObject(object.inputConfig); + } return message; }; /** - * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @static - * @param {google.cloud.automl.v1.TextSnippet} message TextSnippet + * @param {google.cloud.automl.v1.ImportDataRequest} message ImportDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextSnippet.toObject = function toObject(message, options) { + ImportDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.content = ""; - object.mimeType = ""; - object.contentUri = ""; + object.name = ""; + object.inputConfig = null; } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.contentUri != null && message.hasOwnProperty("contentUri")) - object.contentUri = message.contentUri; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.InputConfig.toObject(message.inputConfig, options); return object; }; /** - * Converts this TextSnippet to JSON. + * Converts this ImportDataRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.TextSnippet + * @memberof google.cloud.automl.v1.ImportDataRequest * @instance * @returns {Object.} JSON object */ - TextSnippet.prototype.toJSON = function toJSON() { + ImportDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TextSnippet; + return ImportDataRequest; })(); - v1.ExamplePayload = (function() { + v1.ExportDataRequest = (function() { /** - * Properties of an ExamplePayload. + * Properties of an ExportDataRequest. * @memberof google.cloud.automl.v1 - * @interface IExamplePayload - * @property {google.cloud.automl.v1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {google.cloud.automl.v1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig */ /** - * Constructs a new ExamplePayload. + * Constructs a new ExportDataRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents an ExamplePayload. - * @implements IExamplePayload + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest * @constructor - * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set */ - function ExamplePayload(properties) { + function ExportDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5551,89 +19686,88 @@ } /** - * ExamplePayload textSnippet. - * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} textSnippet - * @memberof google.cloud.automl.v1.ExamplePayload + * ExportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ExportDataRequest * @instance */ - ExamplePayload.prototype.textSnippet = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ExportDataRequest.prototype.name = ""; /** - * ExamplePayload payload. - * @member {"textSnippet"|undefined} payload - * @memberof google.cloud.automl.v1.ExamplePayload + * ExportDataRequest outputConfig. + * @member {google.cloud.automl.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportDataRequest * @instance */ - Object.defineProperty(ExamplePayload.prototype, "payload", { - get: $util.oneOfGetter($oneOfFields = ["textSnippet"]), - set: $util.oneOfSetter($oneOfFields) - }); + ExportDataRequest.prototype.outputConfig = null; /** - * Creates a new ExamplePayload instance using the specified properties. + * Creates a new ExportDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static - * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload instance + * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest instance */ - ExamplePayload.create = function create(properties) { - return new ExamplePayload(properties); + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); }; /** - * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static - * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExamplePayload.encode = function encode(message, writer) { + ExportDataRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) - $root.google.cloud.automl.v1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.automl.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static - * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExamplePayload message from the specified reader or buffer. + * Decodes an ExportDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExamplePayload.decode = function decode(reader, length) { + ExportDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExamplePayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + case 1: + message.name = reader.string(); + break; + case 3: + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5644,119 +19778,121 @@ }; /** - * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExamplePayload message. + * Verifies an ExportDataRequest message. * @function verify - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExamplePayload.verify = function verify(message) { + ExportDataRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { - properties.payload = 1; - { - var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.textSnippet); - if (error) - return "textSnippet." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; } return null; }; /** - * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest */ - ExamplePayload.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ExamplePayload) + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataRequest) return object; - var message = new $root.google.cloud.automl.v1.ExamplePayload(); - if (object.textSnippet != null) { - if (typeof object.textSnippet !== "object") - throw TypeError(".google.cloud.automl.v1.ExamplePayload.textSnippet: object expected"); - message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.textSnippet); + var message = new $root.google.cloud.automl.v1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.fromObject(object.outputConfig); } return message; }; /** - * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @static - * @param {google.cloud.automl.v1.ExamplePayload} message ExamplePayload + * @param {google.cloud.automl.v1.ExportDataRequest} message ExportDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExamplePayload.toObject = function toObject(message, options) { + ExportDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { - object.textSnippet = $root.google.cloud.automl.v1.TextSnippet.toObject(message.textSnippet, options); - if (options.oneofs) - object.payload = "textSnippet"; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.OutputConfig.toObject(message.outputConfig, options); return object; }; /** - * Converts this ExamplePayload to JSON. + * Converts this ExportDataRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ExamplePayload + * @memberof google.cloud.automl.v1.ExportDataRequest * @instance * @returns {Object.} JSON object */ - ExamplePayload.prototype.toJSON = function toJSON() { + ExportDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExamplePayload; + return ExportDataRequest; })(); - v1.InputConfig = (function() { + v1.GetAnnotationSpecRequest = (function() { /** - * Properties of an InputConfig. + * Properties of a GetAnnotationSpecRequest. * @memberof google.cloud.automl.v1 - * @interface IInputConfig - * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource - * @property {Object.|null} [params] InputConfig params + * @interface IGetAnnotationSpecRequest + * @property {string|null} [name] GetAnnotationSpecRequest name */ /** - * Constructs a new InputConfig. + * Constructs a new GetAnnotationSpecRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents an InputConfig. - * @implements IInputConfig + * @classdesc Represents a GetAnnotationSpecRequest. + * @implements IGetAnnotationSpecRequest * @constructor - * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set */ - function InputConfig(properties) { - this.params = {}; + function GetAnnotationSpecRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5764,108 +19900,75 @@ } /** - * InputConfig gcsSource. - * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.automl.v1.InputConfig - * @instance - */ - InputConfig.prototype.gcsSource = null; - - /** - * InputConfig params. - * @member {Object.} params - * @memberof google.cloud.automl.v1.InputConfig - * @instance - */ - InputConfig.prototype.params = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InputConfig source. - * @member {"gcsSource"|undefined} source - * @memberof google.cloud.automl.v1.InputConfig + * GetAnnotationSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @instance */ - Object.defineProperty(InputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetAnnotationSpecRequest.prototype.name = ""; /** - * Creates a new InputConfig instance using the specified properties. + * Creates a new GetAnnotationSpecRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static - * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set - * @returns {google.cloud.automl.v1.InputConfig} InputConfig instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest instance */ - InputConfig.create = function create(properties) { - return new InputConfig(properties); + GetAnnotationSpecRequest.create = function create(properties) { + return new GetAnnotationSpecRequest(properties); }; /** - * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static - * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputConfig.encode = function encode(message, writer) { + GetAnnotationSpecRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) - $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.params != null && message.hasOwnProperty("params")) - for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static - * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + GetAnnotationSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InputConfig message from the specified reader or buffer. + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputConfig.decode = function decode(reader, length) { + GetAnnotationSpecRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.InputConfig(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); - break; - case 2: - reader.skip().pos++; - if (message.params === $util.emptyObject) - message.params = {}; - key = reader.string(); - reader.pos++; - message.params[key] = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -5876,140 +19979,108 @@ }; /** - * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputConfig.decodeDelimited = function decodeDelimited(reader) { + GetAnnotationSpecRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InputConfig message. + * Verifies a GetAnnotationSpecRequest message. * @function verify - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InputConfig.verify = function verify(message) { + GetAnnotationSpecRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - properties.source = 1; - { - var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.params[key[i]])) - return "params: string{k:string} expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest */ - InputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.InputConfig) + GetAnnotationSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetAnnotationSpecRequest) return object; - var message = new $root.google.cloud.automl.v1.InputConfig(); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.automl.v1.InputConfig.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); - } - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.automl.v1.InputConfig.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) - message.params[keys[i]] = String(object.params[keys[i]]); - } + var message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @static - * @param {google.cloud.automl.v1.InputConfig} message InputConfig + * @param {google.cloud.automl.v1.GetAnnotationSpecRequest} message GetAnnotationSpecRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InputConfig.toObject = function toObject(message, options) { + GetAnnotationSpecRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.params = {}; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = message.params[keys2[j]]; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this InputConfig to JSON. + * Converts this GetAnnotationSpecRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.InputConfig + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest * @instance * @returns {Object.} JSON object */ - InputConfig.prototype.toJSON = function toJSON() { + GetAnnotationSpecRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return InputConfig; + return GetAnnotationSpecRequest; })(); - v1.OutputConfig = (function() { + v1.CreateModelRequest = (function() { /** - * Properties of an OutputConfig. + * Properties of a CreateModelRequest. * @memberof google.cloud.automl.v1 - * @interface IOutputConfig - * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.automl.v1.IModel|null} [model] CreateModelRequest model */ /** - * Constructs a new OutputConfig. + * Constructs a new CreateModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents an OutputConfig. - * @implements IOutputConfig + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest * @constructor - * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set */ - function OutputConfig(properties) { + function CreateModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6017,89 +20088,88 @@ } /** - * OutputConfig gcsDestination. - * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination - * @memberof google.cloud.automl.v1.OutputConfig + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.CreateModelRequest * @instance */ - OutputConfig.prototype.gcsDestination = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateModelRequest.prototype.parent = ""; /** - * OutputConfig destination. - * @member {"gcsDestination"|undefined} destination - * @memberof google.cloud.automl.v1.OutputConfig + * CreateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.CreateModelRequest * @instance */ - Object.defineProperty(OutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateModelRequest.prototype.model = null; /** - * Creates a new OutputConfig instance using the specified properties. + * Creates a new CreateModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static - * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set - * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig instance + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest instance */ - OutputConfig.create = function create(properties) { - return new OutputConfig(properties); + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); }; /** - * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static - * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encode = function encode(message, writer) { + CreateModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.model != null && message.hasOwnProperty("model")) + $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static - * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputConfig message from the specified reader or buffer. + * Decodes a CreateModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decode = function decode(reader, length) { + CreateModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OutputConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + case 4: + message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6110,118 +20180,121 @@ }; /** - * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputConfig.decodeDelimited = function decodeDelimited(reader) { + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputConfig message. + * Verifies a CreateModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputConfig.verify = function verify(message) { + CreateModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - properties.destination = 1; - { - var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); - if (error) - return "gcsDestination." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + error; } return null; }; /** - * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest */ - OutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.OutputConfig) + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelRequest) return object; - var message = new $root.google.cloud.automl.v1.OutputConfig(); - if (object.gcsDestination != null) { - if (typeof object.gcsDestination !== "object") - throw TypeError(".google.cloud.automl.v1.OutputConfig.gcsDestination: object expected"); - message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + var message = new $root.google.cloud.automl.v1.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); } return message; }; /** - * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @static - * @param {google.cloud.automl.v1.OutputConfig} message OutputConfig + * @param {google.cloud.automl.v1.CreateModelRequest} message CreateModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputConfig.toObject = function toObject(message, options) { + CreateModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { - object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); - if (options.oneofs) - object.destination = "gcsDestination"; + if (options.defaults) { + object.parent = ""; + object.model = null; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); return object; }; /** - * Converts this OutputConfig to JSON. + * Converts this CreateModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.OutputConfig + * @memberof google.cloud.automl.v1.CreateModelRequest * @instance * @returns {Object.} JSON object */ - OutputConfig.prototype.toJSON = function toJSON() { + CreateModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputConfig; + return CreateModelRequest; })(); - v1.GcsSource = (function() { + v1.GetModelRequest = (function() { /** - * Properties of a GcsSource. + * Properties of a GetModelRequest. * @memberof google.cloud.automl.v1 - * @interface IGcsSource - * @property {Array.|null} [inputUris] GcsSource inputUris + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name */ /** - * Constructs a new GcsSource. + * Constructs a new GetModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a GcsSource. - * @implements IGcsSource + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest * @constructor - * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set */ - function GcsSource(properties) { - this.inputUris = []; + function GetModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6229,78 +20302,75 @@ } /** - * GcsSource inputUris. - * @member {Array.} inputUris - * @memberof google.cloud.automl.v1.GcsSource + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelRequest * @instance */ - GcsSource.prototype.inputUris = $util.emptyArray; + GetModelRequest.prototype.name = ""; /** - * Creates a new GcsSource instance using the specified properties. + * Creates a new GetModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static - * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set - * @returns {google.cloud.automl.v1.GcsSource} GcsSource instance + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest instance */ - GcsSource.create = function create(properties) { - return new GcsSource(properties); + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); }; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static - * @param {google.cloud.automl.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encode = function encode(message, writer) { + GetModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inputUris != null && message.inputUris.length) - for (var i = 0; i < message.inputUris.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static - * @param {google.cloud.automl.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a GetModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.GcsSource} GcsSource + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest * @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) { + GetModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.inputUris && message.inputUris.length)) - message.inputUris = []; - message.inputUris.push(reader.string()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6311,119 +20381,110 @@ }; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.GcsSource} GcsSource + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest * @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) { + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsSource message. + * Verifies a GetModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @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) { + GetModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inputUris != null && message.hasOwnProperty("inputUris")) { - if (!Array.isArray(message.inputUris)) - return "inputUris: array expected"; - for (var i = 0; i < message.inputUris.length; ++i) - if (!$util.isString(message.inputUris[i])) - return "inputUris: string[] expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.GcsSource} GcsSource + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest */ - GcsSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.GcsSource) + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelRequest) return object; - var message = new $root.google.cloud.automl.v1.GcsSource(); - if (object.inputUris) { - if (!Array.isArray(object.inputUris)) - throw TypeError(".google.cloud.automl.v1.GcsSource.inputUris: array expected"); - message.inputUris = []; - for (var i = 0; i < object.inputUris.length; ++i) - message.inputUris[i] = String(object.inputUris[i]); - } + var message = new $root.google.cloud.automl.v1.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @static - * @param {google.cloud.automl.v1.GcsSource} message GcsSource + * @param {google.cloud.automl.v1.GetModelRequest} message GetModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsSource.toObject = function toObject(message, options) { + GetModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.inputUris = []; - if (message.inputUris && message.inputUris.length) { - object.inputUris = []; - for (var j = 0; j < message.inputUris.length; ++j) - object.inputUris[j] = message.inputUris[j]; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GcsSource to JSON. + * Converts this GetModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.GcsSource + * @memberof google.cloud.automl.v1.GetModelRequest * @instance * @returns {Object.} JSON object */ - GcsSource.prototype.toJSON = function toJSON() { + GetModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsSource; + return GetModelRequest; })(); - v1.GcsDestination = (function() { + v1.ListModelsRequest = (function() { /** - * Properties of a GcsDestination. + * Properties of a ListModelsRequest. * @memberof google.cloud.automl.v1 - * @interface IGcsDestination - * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {string|null} [filter] ListModelsRequest filter + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken */ /** - * Constructs a new GcsDestination. + * Constructs a new ListModelsRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a GcsDestination. - * @implements IGcsDestination + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest * @constructor - * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set */ - function GcsDestination(properties) { + function ListModelsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6431,75 +20492,114 @@ } /** - * GcsDestination outputUriPrefix. - * @member {string} outputUriPrefix - * @memberof google.cloud.automl.v1.GcsDestination + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelsRequest * @instance */ - GcsDestination.prototype.outputUriPrefix = ""; + ListModelsRequest.prototype.parent = ""; /** - * Creates a new GcsDestination instance using the specified properties. + * ListModelsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.filter = ""; + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static - * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set - * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination instance + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest instance */ - GcsDestination.create = function create(properties) { - return new GcsDestination(properties); + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); }; /** - * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static - * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encode = function encode(message, writer) { + ListModelsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); return writer; }; /** - * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static - * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsDestination message from the specified reader or buffer. + * Decodes a ListModelsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decode = function decode(reader, length) { + ListModelsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsDestination(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.outputUriPrefix = reader.string(); + message.parent = reader.string(); + break; + case 3: + message.filter = reader.string(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6510,115 +20610,134 @@ }; /** - * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsDestination.decodeDelimited = function decodeDelimited(reader) { + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsDestination message. + * Verifies a ListModelsRequest message. * @function verify - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsDestination.verify = function verify(message) { + ListModelsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - if (!$util.isString(message.outputUriPrefix)) - return "outputUriPrefix: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 GcsDestination message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest */ - GcsDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.GcsDestination) + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsRequest) return object; - var message = new $root.google.cloud.automl.v1.GcsDestination(); - if (object.outputUriPrefix != null) - message.outputUriPrefix = String(object.outputUriPrefix); + var message = new $root.google.cloud.automl.v1.ListModelsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + 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 GcsDestination message. Also converts values to other types if specified. + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @static - * @param {google.cloud.automl.v1.GcsDestination} message GcsDestination + * @param {google.cloud.automl.v1.ListModelsRequest} message ListModelsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsDestination.toObject = function toObject(message, options) { + ListModelsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.outputUriPrefix = ""; - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - object.outputUriPrefix = message.outputUriPrefix; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + 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 GcsDestination to JSON. + * Converts this ListModelsRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.GcsDestination + * @memberof google.cloud.automl.v1.ListModelsRequest * @instance * @returns {Object.} JSON object */ - GcsDestination.prototype.toJSON = function toJSON() { + ListModelsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsDestination; + return ListModelsRequest; })(); - v1.Dataset = (function() { + v1.ListModelsResponse = (function() { /** - * Properties of a Dataset. + * Properties of a ListModelsResponse. * @memberof google.cloud.automl.v1 - * @interface IDataset - * @property {google.cloud.automl.v1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata - * @property {string|null} [name] Dataset name - * @property {string|null} [displayName] Dataset displayName - * @property {string|null} [description] Dataset description - * @property {number|null} [exampleCount] Dataset exampleCount - * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime - * @property {string|null} [etag] Dataset etag - * @property {Object.|null} [labels] Dataset labels + * @interface IListModelsResponse + * @property {Array.|null} [model] ListModelsResponse model + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken */ /** - * Constructs a new Dataset. + * Constructs a new ListModelsResponse. * @memberof google.cloud.automl.v1 - * @classdesc Represents a Dataset. - * @implements IDataset + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse * @constructor - * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set */ - function Dataset(properties) { - this.labels = {}; + function ListModelsResponse(properties) { + this.model = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6626,186 +20745,91 @@ } /** - * Dataset translationDatasetMetadata. - * @member {google.cloud.automl.v1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.translationDatasetMetadata = null; - - /** - * Dataset name. - * @member {string} name - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.name = ""; - - /** - * Dataset displayName. - * @member {string} displayName - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.displayName = ""; - - /** - * Dataset description. - * @member {string} description - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.description = ""; - - /** - * Dataset exampleCount. - * @member {number} exampleCount - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.exampleCount = 0; - - /** - * Dataset createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.createTime = null; - - /** - * Dataset etag. - * @member {string} etag - * @memberof google.cloud.automl.v1.Dataset - * @instance - */ - Dataset.prototype.etag = ""; - - /** - * Dataset labels. - * @member {Object.} labels - * @memberof google.cloud.automl.v1.Dataset + * ListModelsResponse model. + * @member {Array.} model + * @memberof google.cloud.automl.v1.ListModelsResponse * @instance */ - Dataset.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListModelsResponse.prototype.model = $util.emptyArray; /** - * Dataset datasetMetadata. - * @member {"translationDatasetMetadata"|undefined} datasetMetadata - * @memberof google.cloud.automl.v1.Dataset + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelsResponse * @instance */ - Object.defineProperty(Dataset.prototype, "datasetMetadata", { - get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListModelsResponse.prototype.nextPageToken = ""; /** - * Creates a new Dataset instance using the specified properties. + * Creates a new ListModelsResponse instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static - * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set - * @returns {google.cloud.automl.v1.Dataset} Dataset instance + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse instance */ - Dataset.create = function create(properties) { - return new Dataset(properties); + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); }; /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static - * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Dataset.encode = function encode(message, writer) { + ListModelsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && message.hasOwnProperty("description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.etag != null && message.hasOwnProperty("etag")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); - if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); - if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) - $root.google.cloud.automl.v1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 39, wireType 2 =*/314).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.model != null && message.model.length) + for (var i = 0; i < message.model.length; ++i) + $root.google.cloud.automl.v1.Model.encode(message.model[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static - * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Dataset.encodeDelimited = function encodeDelimited(message, writer) { + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Dataset message from the specified reader or buffer. + * Decodes a ListModelsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.Dataset} Dataset + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Dataset.decode = function decode(reader, length) { + ListModelsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Dataset(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 23: - message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.decode(reader, reader.uint32()); - break; case 1: - message.name = reader.string(); + if (!(message.model && message.model.length)) + message.model = []; + message.model.push($root.google.cloud.automl.v1.Model.decode(reader, reader.uint32())); break; case 2: - message.displayName = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 21: - message.exampleCount = reader.int32(); - break; - case 14: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 17: - message.etag = reader.string(); - break; - case 39: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6816,203 +20840,133 @@ }; /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.Dataset} Dataset + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Dataset.decodeDelimited = function decodeDelimited(reader) { + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Dataset message. + * Verifies a ListModelsResponse message. * @function verify - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Dataset.verify = function verify(message) { + ListModelsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { - properties.datasetMetadata = 1; - { - var error = $root.google.cloud.automl.v1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (message.model != null && message.hasOwnProperty("model")) { + if (!Array.isArray(message.model)) + return "model: array expected"; + for (var i = 0; i < message.model.length; ++i) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model[i]); if (error) - return "translationDatasetMetadata." + error; + return "model." + error; } } - 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.exampleCount != null && message.hasOwnProperty("exampleCount")) - if (!$util.isInteger(message.exampleCount)) - return "exampleCount: integer expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - 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.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.Dataset} Dataset + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse */ - Dataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.Dataset) + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsResponse) return object; - var message = new $root.google.cloud.automl.v1.Dataset(); - if (object.translationDatasetMetadata != null) { - if (typeof object.translationDatasetMetadata !== "object") - throw TypeError(".google.cloud.automl.v1.Dataset.translationDatasetMetadata: object expected"); - message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); - } - 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.exampleCount != null) - message.exampleCount = object.exampleCount | 0; - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.automl.v1.Dataset.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.automl.v1.Dataset.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); + var message = new $root.google.cloud.automl.v1.ListModelsResponse(); + if (object.model) { + if (!Array.isArray(object.model)) + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: array expected"); + message.model = []; + for (var i = 0; i < object.model.length; ++i) { + if (typeof object.model[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: object expected"); + message.model[i] = $root.google.cloud.automl.v1.Model.fromObject(object.model[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @static - * @param {google.cloud.automl.v1.Dataset} message Dataset + * @param {google.cloud.automl.v1.ListModelsResponse} message ListModelsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Dataset.toObject = function toObject(message, options) { + ListModelsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.etag = ""; - object.exampleCount = 0; - } - 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.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) - object.exampleCount = message.exampleCount; - if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { - object.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); - if (options.oneofs) - object.datasetMetadata = "translationDatasetMetadata"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (options.arrays || options.defaults) + object.model = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.model && message.model.length) { + object.model = []; + for (var j = 0; j < message.model.length; ++j) + object.model[j] = $root.google.cloud.automl.v1.Model.toObject(message.model[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Dataset to JSON. + * Converts this ListModelsResponse to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.Dataset + * @memberof google.cloud.automl.v1.ListModelsResponse * @instance * @returns {Object.} JSON object */ - Dataset.prototype.toJSON = function toJSON() { + ListModelsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Dataset; + return ListModelsResponse; })(); - v1.Model = (function() { + v1.DeleteModelRequest = (function() { /** - * Properties of a Model. + * Properties of a DeleteModelRequest. * @memberof google.cloud.automl.v1 - * @interface IModel - * @property {google.cloud.automl.v1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata - * @property {string|null} [name] Model name - * @property {string|null} [displayName] Model displayName - * @property {string|null} [datasetId] Model datasetId - * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime - * @property {google.cloud.automl.v1.Model.DeploymentState|null} [deploymentState] Model deploymentState - * @property {Object.|null} [labels] Model labels + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name */ /** - * Constructs a new Model. + * Constructs a new DeleteModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a Model. - * @implements IModel + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest * @constructor - * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set */ - function Model(properties) { - this.labels = {}; + function DeleteModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7020,187 +20974,76 @@ } /** - * Model translationModelMetadata. - * @member {google.cloud.automl.v1.ITranslationModelMetadata|null|undefined} translationModelMetadata - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.translationModelMetadata = null; - - /** - * Model name. + * DeleteModelRequest name. * @member {string} name - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.name = ""; - - /** - * Model displayName. - * @member {string} displayName - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.displayName = ""; - - /** - * Model datasetId. - * @member {string} datasetId - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.datasetId = ""; - - /** - * Model createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.createTime = null; - - /** - * Model updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.updateTime = null; - - /** - * Model deploymentState. - * @member {google.cloud.automl.v1.Model.DeploymentState} deploymentState - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.deploymentState = 0; - - /** - * Model labels. - * @member {Object.} labels - * @memberof google.cloud.automl.v1.Model - * @instance - */ - Model.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Model modelMetadata. - * @member {"translationModelMetadata"|undefined} modelMetadata - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @instance */ - Object.defineProperty(Model.prototype, "modelMetadata", { - get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteModelRequest.prototype.name = ""; /** - * Creates a new Model instance using the specified properties. + * Creates a new DeleteModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static - * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set - * @returns {google.cloud.automl.v1.Model} Model instance + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest instance */ - Model.create = function create(properties) { - return new Model(properties); + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); }; /** - * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static - * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encode = function encode(message, writer) { + DeleteModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && message.hasOwnProperty("name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && message.hasOwnProperty("displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.datasetId != null && message.hasOwnProperty("datasetId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) - $root.google.cloud.automl.v1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.labels != null && message.hasOwnProperty("labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 34, wireType 2 =*/274).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static - * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encodeDelimited = function encodeDelimited(message, writer) { + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Model message from the specified reader or buffer. + * Decodes a DeleteModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.Model} Model + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Model.decode = function decode(reader, length) { + DeleteModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Model(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 15: - message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.decode(reader, reader.uint32()); - break; case 1: message.name = reader.string(); break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.datasetId = reader.string(); - break; - case 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.deploymentState = reader.int32(); - break; - case 34: - reader.skip().pos++; - if (message.labels === $util.emptyObject) - message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -7210,238 +21053,108 @@ }; /** - * Decodes a Model message from the specified reader or buffer, length delimited. + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.Model} Model + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Model.decodeDelimited = function decodeDelimited(reader) { + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Model message. + * Verifies a DeleteModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Model.verify = function verify(message) { + DeleteModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { - properties.modelMetadata = 1; - { - var error = $root.google.cloud.automl.v1.TranslationModelMetadata.verify(message.translationModelMetadata); - if (error) - return "translationModelMetadata." + error; - } - } 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.datasetId != null && message.hasOwnProperty("datasetId")) - if (!$util.isString(message.datasetId)) - return "datasetId: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) - switch (message.deploymentState) { - default: - return "deploymentState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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"; - } return null; }; /** - * Creates a Model message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.Model} Model + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest */ - Model.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.Model) + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteModelRequest) return object; - var message = new $root.google.cloud.automl.v1.Model(); - if (object.translationModelMetadata != null) { - if (typeof object.translationModelMetadata !== "object") - throw TypeError(".google.cloud.automl.v1.Model.translationModelMetadata: object expected"); - message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.fromObject(object.translationModelMetadata); - } + var message = new $root.google.cloud.automl.v1.DeleteModelRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.datasetId != null) - message.datasetId = String(object.datasetId); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.automl.v1.Model.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.automl.v1.Model.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.deploymentState) { - case "DEPLOYMENT_STATE_UNSPECIFIED": - case 0: - message.deploymentState = 0; - break; - case "DEPLOYED": - case 1: - message.deploymentState = 1; - break; - case "UNDEPLOYED": - case 2: - message.deploymentState = 2; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.automl.v1.Model.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } return message; }; /** - * Creates a plain object from a Model message. Also converts values to other types if specified. + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @static - * @param {google.cloud.automl.v1.Model} message Model + * @param {google.cloud.automl.v1.DeleteModelRequest} message DeleteModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Model.toObject = function toObject(message, options) { + DeleteModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.displayName = ""; - object.datasetId = ""; - object.createTime = null; - object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; - object.updateTime = 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.datasetId != null && message.hasOwnProperty("datasetId")) - object.datasetId = message.datasetId; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) - object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] : message.deploymentState; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { - object.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); - if (options.oneofs) - object.modelMetadata = "translationModelMetadata"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } return object; }; /** - * Converts this Model to JSON. + * Converts this DeleteModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.Model + * @memberof google.cloud.automl.v1.DeleteModelRequest * @instance * @returns {Object.} JSON object */ - Model.prototype.toJSON = function toJSON() { + DeleteModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * DeploymentState enum. - * @name google.cloud.automl.v1.Model.DeploymentState - * @enum {string} - * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value - * @property {number} DEPLOYED=1 DEPLOYED value - * @property {number} UNDEPLOYED=2 UNDEPLOYED value - */ - Model.DeploymentState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEPLOYED"] = 1; - values[valuesById[2] = "UNDEPLOYED"] = 2; - return values; - })(); - - return Model; + return DeleteModelRequest; })(); - v1.ModelEvaluation = (function() { + v1.UpdateModelRequest = (function() { /** - * Properties of a ModelEvaluation. + * Properties of an UpdateModelRequest. * @memberof google.cloud.automl.v1 - * @interface IModelEvaluation - * @property {google.cloud.automl.v1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics - * @property {string|null} [name] ModelEvaluation name - * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId - * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime - * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + * @interface IUpdateModelRequest + * @property {google.cloud.automl.v1.IModel|null} [model] UpdateModelRequest model + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask */ /** - * Constructs a new ModelEvaluation. + * Constructs a new UpdateModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a ModelEvaluation. - * @implements IModelEvaluation + * @classdesc Represents an UpdateModelRequest. + * @implements IUpdateModelRequest * @constructor - * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set */ - function ModelEvaluation(properties) { + function UpdateModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7449,141 +21162,88 @@ } /** - * ModelEvaluation translationEvaluationMetrics. - * @member {google.cloud.automl.v1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics - * @memberof google.cloud.automl.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.translationEvaluationMetrics = null; - - /** - * ModelEvaluation name. - * @member {string} name - * @memberof google.cloud.automl.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.name = ""; - - /** - * ModelEvaluation annotationSpecId. - * @member {string} annotationSpecId - * @memberof google.cloud.automl.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.annotationSpecId = ""; - - /** - * ModelEvaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.automl.v1.ModelEvaluation - * @instance - */ - ModelEvaluation.prototype.createTime = null; - - /** - * ModelEvaluation evaluatedExampleCount. - * @member {number} evaluatedExampleCount - * @memberof google.cloud.automl.v1.ModelEvaluation + * UpdateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.UpdateModelRequest * @instance */ - ModelEvaluation.prototype.evaluatedExampleCount = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + UpdateModelRequest.prototype.model = null; /** - * ModelEvaluation metrics. - * @member {"translationEvaluationMetrics"|undefined} metrics - * @memberof google.cloud.automl.v1.ModelEvaluation + * UpdateModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateModelRequest * @instance */ - Object.defineProperty(ModelEvaluation.prototype, "metrics", { - get: $util.oneOfGetter($oneOfFields = ["translationEvaluationMetrics"]), - set: $util.oneOfSetter($oneOfFields) - }); + UpdateModelRequest.prototype.updateMask = null; /** - * Creates a new ModelEvaluation instance using the specified properties. + * Creates a new UpdateModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static - * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set - * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation instance + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest instance */ - ModelEvaluation.create = function create(properties) { - return new ModelEvaluation(properties); + UpdateModelRequest.create = function create(properties) { + return new UpdateModelRequest(properties); }; /** - * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static - * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluation.encode = function encode(message, writer) { + UpdateModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); - if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) - $root.google.cloud.automl.v1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.model != null && message.hasOwnProperty("model")) + $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static - * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ModelEvaluation message from the specified reader or buffer. + * Decodes an UpdateModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluation.decode = function decode(reader, length) { + UpdateModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelEvaluation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 9: - message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); - break; case 1: - message.name = reader.string(); + message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); break; case 2: - message.annotationSpecId = reader.string(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.evaluatedExampleCount = reader.int32(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7594,162 +21254,128 @@ }; /** - * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + UpdateModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ModelEvaluation message. + * Verifies an UpdateModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ModelEvaluation.verify = function verify(message) { + UpdateModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { - properties.metrics = 1; - { - var error = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); - if (error) - return "translationEvaluationMetrics." + error; - } + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + error; } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) - if (!$util.isString(message.annotationSpecId)) - return "annotationSpecId: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "createTime." + error; + return "updateMask." + error; } - if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) - if (!$util.isInteger(message.evaluatedExampleCount)) - return "evaluatedExampleCount: integer expected"; return null; }; /** - * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest */ - ModelEvaluation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.ModelEvaluation) + UpdateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateModelRequest) return object; - var message = new $root.google.cloud.automl.v1.ModelEvaluation(); - if (object.translationEvaluationMetrics != null) { - if (typeof object.translationEvaluationMetrics !== "object") - throw TypeError(".google.cloud.automl.v1.ModelEvaluation.translationEvaluationMetrics: object expected"); - message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + var message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); } - if (object.name != null) - message.name = String(object.name); - if (object.annotationSpecId != null) - message.annotationSpecId = String(object.annotationSpecId); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.automl.v1.ModelEvaluation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.evaluatedExampleCount != null) - message.evaluatedExampleCount = object.evaluatedExampleCount | 0; return message; }; /** - * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @static - * @param {google.cloud.automl.v1.ModelEvaluation} message ModelEvaluation + * @param {google.cloud.automl.v1.UpdateModelRequest} message UpdateModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ModelEvaluation.toObject = function toObject(message, options) { + UpdateModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.annotationSpecId = ""; - object.createTime = null; - object.evaluatedExampleCount = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) - object.annotationSpecId = message.annotationSpecId; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) - object.evaluatedExampleCount = message.evaluatedExampleCount; - if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { - object.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); - if (options.oneofs) - object.metrics = "translationEvaluationMetrics"; + object.model = null; + object.updateMask = null; } + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ModelEvaluation to JSON. + * Converts this UpdateModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.ModelEvaluation + * @memberof google.cloud.automl.v1.UpdateModelRequest * @instance * @returns {Object.} JSON object */ - ModelEvaluation.prototype.toJSON = function toJSON() { + UpdateModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ModelEvaluation; + return UpdateModelRequest; })(); - v1.OperationMetadata = (function() { + v1.DeployModelRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a DeployModelRequest. * @memberof google.cloud.automl.v1 - * @interface IOperationMetadata - * @property {google.cloud.automl.v1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails - * @property {google.cloud.automl.v1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails - * @property {number|null} [progressPercent] OperationMetadata progressPercent - * @property {Array.|null} [partialFailures] OperationMetadata partialFailures - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + * @interface IDeployModelRequest + * @property {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null} [imageObjectDetectionModelDeploymentMetadata] DeployModelRequest imageObjectDetectionModelDeploymentMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null} [imageClassificationModelDeploymentMetadata] DeployModelRequest imageClassificationModelDeploymentMetadata + * @property {string|null} [name] DeployModelRequest name */ /** - * Constructs a new OperationMetadata. + * Constructs a new DeployModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a DeployModelRequest. + * @implements IDeployModelRequest * @constructor - * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { - this.partialFailures = []; + function DeployModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7757,157 +21383,115 @@ } /** - * OperationMetadata deleteDetails. - * @member {google.cloud.automl.v1.IDeleteOperationMetadata|null|undefined} deleteDetails - * @memberof google.cloud.automl.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.deleteDetails = null; - - /** - * OperationMetadata createModelDetails. - * @member {google.cloud.automl.v1.ICreateModelOperationMetadata|null|undefined} createModelDetails - * @memberof google.cloud.automl.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createModelDetails = null; - - /** - * OperationMetadata progressPercent. - * @member {number} progressPercent - * @memberof google.cloud.automl.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.progressPercent = 0; - - /** - * OperationMetadata partialFailures. - * @member {Array.} partialFailures - * @memberof google.cloud.automl.v1.OperationMetadata + * DeployModelRequest imageObjectDetectionModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null|undefined} imageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @instance */ - OperationMetadata.prototype.partialFailures = $util.emptyArray; + DeployModelRequest.prototype.imageObjectDetectionModelDeploymentMetadata = null; /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.automl.v1.OperationMetadata + * DeployModelRequest imageClassificationModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null|undefined} imageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @instance */ - OperationMetadata.prototype.createTime = null; + DeployModelRequest.prototype.imageClassificationModelDeploymentMetadata = null; /** - * OperationMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.automl.v1.OperationMetadata + * DeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeployModelRequest * @instance */ - OperationMetadata.prototype.updateTime = null; + DeployModelRequest.prototype.name = ""; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * OperationMetadata details. - * @member {"deleteDetails"|"createModelDetails"|undefined} details - * @memberof google.cloud.automl.v1.OperationMetadata + * DeployModelRequest modelDeploymentMetadata. + * @member {"imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"|undefined} modelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @instance */ - Object.defineProperty(OperationMetadata.prototype, "details", { - get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "createModelDetails"]), + Object.defineProperty(DeployModelRequest.prototype, "modelDeploymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageObjectDetectionModelDeploymentMetadata", "imageClassificationModelDeploymentMetadata"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new DeployModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static - * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + DeployModelRequest.create = function create(properties) { + return new DeployModelRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static - * @param {google.cloud.automl.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + DeployModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.partialFailures != null && message.partialFailures.length) - for (var i = 0; i < message.partialFailures.length; ++i) - $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.createTime != null && message.hasOwnProperty("createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) - $root.google.cloud.automl.v1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) - $root.google.cloud.automl.v1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.encode(message.imageObjectDetectionModelDeploymentMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.encode(message.imageClassificationModelDeploymentMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static - * @param {google.cloud.automl.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a DeployModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest * @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) { + DeployModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: - message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.decode(reader, reader.uint32()); - break; - case 10: - message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.decode(reader, reader.uint32()); - break; - case 13: - message.progressPercent = reader.int32(); - break; case 2: - if (!(message.partialFailures && message.partialFailures.length)) - message.partialFailures = []; - message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.decode(reader, reader.uint32()); break; case 4: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + case 1: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -7918,198 +21502,146 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest * @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) { + DeployModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a DeployModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @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) { + DeployModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { - properties.details = 1; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + properties.modelDeploymentMetadata = 1; { - var error = $root.google.cloud.automl.v1.DeleteOperationMetadata.verify(message.deleteDetails); + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify(message.imageObjectDetectionModelDeploymentMetadata); if (error) - return "deleteDetails." + error; + return "imageObjectDetectionModelDeploymentMetadata." + error; } } - if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { - if (properties.details === 1) - return "details: multiple values"; - properties.details = 1; + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + if (properties.modelDeploymentMetadata === 1) + return "modelDeploymentMetadata: multiple values"; + properties.modelDeploymentMetadata = 1; { - var error = $root.google.cloud.automl.v1.CreateModelOperationMetadata.verify(message.createModelDetails); + var error = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify(message.imageClassificationModelDeploymentMetadata); if (error) - return "createModelDetails." + error; - } - } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - if (!$util.isInteger(message.progressPercent)) - return "progressPercent: integer expected"; - if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { - if (!Array.isArray(message.partialFailures)) - return "partialFailures: array expected"; - for (var i = 0; i < message.partialFailures.length; ++i) { - var error = $root.google.rpc.Status.verify(message.partialFailures[i]); - if (error) - return "partialFailures." + error; + return "imageClassificationModelDeploymentMetadata." + error; } } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.OperationMetadata) + DeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelRequest) return object; - var message = new $root.google.cloud.automl.v1.OperationMetadata(); - if (object.deleteDetails != null) { - if (typeof object.deleteDetails !== "object") - throw TypeError(".google.cloud.automl.v1.OperationMetadata.deleteDetails: object expected"); - message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.fromObject(object.deleteDetails); - } - if (object.createModelDetails != null) { - if (typeof object.createModelDetails !== "object") - throw TypeError(".google.cloud.automl.v1.OperationMetadata.createModelDetails: object expected"); - message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.fromObject(object.createModelDetails); - } - if (object.progressPercent != null) - message.progressPercent = object.progressPercent | 0; - if (object.partialFailures) { - if (!Array.isArray(object.partialFailures)) - throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: array expected"); - message.partialFailures = []; - for (var i = 0; i < object.partialFailures.length; ++i) { - if (typeof object.partialFailures[i] !== "object") - throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: object expected"); - message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.automl.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.automl.v1.DeployModelRequest(); + if (object.imageObjectDetectionModelDeploymentMetadata != null) { + if (typeof object.imageObjectDetectionModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageObjectDetectionModelDeploymentMetadata: object expected"); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.fromObject(object.imageObjectDetectionModelDeploymentMetadata); } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.automl.v1.OperationMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + if (object.imageClassificationModelDeploymentMetadata != null) { + if (typeof object.imageClassificationModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageClassificationModelDeploymentMetadata: object expected"); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.fromObject(object.imageClassificationModelDeploymentMetadata); } + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @static - * @param {google.cloud.automl.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.automl.v1.DeployModelRequest} message DeployModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + DeployModelRequest.toObject = function toObject(message, options) { if (!options) options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.partialFailures = []; - if (options.defaults) { - object.createTime = null; - object.updateTime = null; - object.progressPercent = 0; - } - if (message.partialFailures && message.partialFailures.length) { - object.partialFailures = []; - for (var j = 0; j < message.partialFailures.length; ++j) - object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[j], options); - } - 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); - if (message.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { - object.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + object.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.toObject(message.imageObjectDetectionModelDeploymentMetadata, options); if (options.oneofs) - object.details = "deleteDetails"; + object.modelDeploymentMetadata = "imageObjectDetectionModelDeploymentMetadata"; } - if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { - object.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + object.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.toObject(message.imageClassificationModelDeploymentMetadata, options); if (options.oneofs) - object.details = "createModelDetails"; + object.modelDeploymentMetadata = "imageClassificationModelDeploymentMetadata"; } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) - object.progressPercent = message.progressPercent; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this DeployModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.OperationMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + DeployModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OperationMetadata; + return DeployModelRequest; })(); - v1.DeleteOperationMetadata = (function() { + v1.UndeployModelRequest = (function() { /** - * Properties of a DeleteOperationMetadata. + * Properties of an UndeployModelRequest. * @memberof google.cloud.automl.v1 - * @interface IDeleteOperationMetadata + * @interface IUndeployModelRequest + * @property {string|null} [name] UndeployModelRequest name */ /** - * Constructs a new DeleteOperationMetadata. + * Constructs a new UndeployModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a DeleteOperationMetadata. - * @implements IDeleteOperationMetadata + * @classdesc Represents an UndeployModelRequest. + * @implements IUndeployModelRequest * @constructor - * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set */ - function DeleteOperationMetadata(properties) { + function UndeployModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8117,63 +21649,76 @@ } /** - * Creates a new DeleteOperationMetadata instance using the specified properties. + * UndeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @instance + */ + UndeployModelRequest.prototype.name = ""; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static - * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata instance + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest instance */ - DeleteOperationMetadata.create = function create(properties) { - return new DeleteOperationMetadata(properties); + UndeployModelRequest.create = function create(properties) { + return new UndeployModelRequest(properties); }; /** - * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static - * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteOperationMetadata.encode = function encode(message, writer) { + UndeployModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static - * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UndeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * Decodes an UndeployModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteOperationMetadata.decode = function decode(reader, length) { + UndeployModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -8183,93 +21728,108 @@ }; /** - * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + UndeployModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteOperationMetadata message. + * Verifies an UndeployModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteOperationMetadata.verify = function verify(message) { + UndeployModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest */ - DeleteOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.DeleteOperationMetadata) + UndeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelRequest) return object; - return new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + var message = new $root.google.cloud.automl.v1.UndeployModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; }; /** - * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @static - * @param {google.cloud.automl.v1.DeleteOperationMetadata} message DeleteOperationMetadata + * @param {google.cloud.automl.v1.UndeployModelRequest} message UndeployModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteOperationMetadata.toObject = function toObject() { - return {}; + UndeployModelRequest.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 DeleteOperationMetadata to JSON. + * Converts this UndeployModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @memberof google.cloud.automl.v1.UndeployModelRequest * @instance * @returns {Object.} JSON object */ - DeleteOperationMetadata.prototype.toJSON = function toJSON() { + UndeployModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteOperationMetadata; + return UndeployModelRequest; })(); - v1.CreateModelOperationMetadata = (function() { + v1.ExportModelRequest = (function() { /** - * Properties of a CreateModelOperationMetadata. + * Properties of an ExportModelRequest. * @memberof google.cloud.automl.v1 - * @interface ICreateModelOperationMetadata + * @interface IExportModelRequest + * @property {string|null} [name] ExportModelRequest name + * @property {google.cloud.automl.v1.IModelExportOutputConfig|null} [outputConfig] ExportModelRequest outputConfig */ /** - * Constructs a new CreateModelOperationMetadata. + * Constructs a new ExportModelRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a CreateModelOperationMetadata. - * @implements ICreateModelOperationMetadata + * @classdesc Represents an ExportModelRequest. + * @implements IExportModelRequest * @constructor - * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set */ - function CreateModelOperationMetadata(properties) { + function ExportModelRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8277,63 +21837,89 @@ } /** - * Creates a new CreateModelOperationMetadata instance using the specified properties. + * ExportModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.name = ""; + + /** + * ExportModelRequest outputConfig. + * @member {google.cloud.automl.v1.IModelExportOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportModelRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static - * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata instance + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest instance */ - CreateModelOperationMetadata.create = function create(properties) { - return new CreateModelOperationMetadata(properties); + ExportModelRequest.create = function create(properties) { + return new ExportModelRequest(properties); }; /** - * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static - * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelOperationMetadata.encode = function encode(message, writer) { + ExportModelRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + $root.google.cloud.automl.v1.ModelExportOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static - * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ExportModelRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * Decodes an ExportModelRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateModelOperationMetadata.decode = function decode(reader, length) { + ExportModelRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -8343,165 +21929,311 @@ }; /** - * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + ExportModelRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateModelOperationMetadata message. + * Verifies an ExportModelRequest message. * @function verify - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateModelOperationMetadata.verify = function verify(message) { + ExportModelRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.ModelExportOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } return null; }; /** - * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest */ - CreateModelOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.CreateModelOperationMetadata) + ExportModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelRequest) return object; - return new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + var message = new $root.google.cloud.automl.v1.ExportModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.fromObject(object.outputConfig); + } + return message; }; /** - * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @static - * @param {google.cloud.automl.v1.CreateModelOperationMetadata} message CreateModelOperationMetadata + * @param {google.cloud.automl.v1.ExportModelRequest} message ExportModelRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateModelOperationMetadata.toObject = function toObject() { - return {}; + ExportModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.toObject(message.outputConfig, options); + return object; }; /** - * Converts this CreateModelOperationMetadata to JSON. + * Converts this ExportModelRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @memberof google.cloud.automl.v1.ExportModelRequest * @instance * @returns {Object.} JSON object */ - CreateModelOperationMetadata.prototype.toJSON = function toJSON() { + ExportModelRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateModelOperationMetadata; + return ExportModelRequest; })(); - v1.PredictionService = (function() { + v1.GetModelEvaluationRequest = (function() { /** - * Constructs a new PredictionService service. + * Properties of a GetModelEvaluationRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a PredictionService - * @extends $protobuf.rpc.Service + * @interface IGetModelEvaluationRequest + * @property {string|null} [name] GetModelEvaluationRequest name + */ + + /** + * Constructs a new GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetModelEvaluationRequest. + * @implements IGetModelEvaluationRequest * @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 + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set */ - function PredictionService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function GetModelEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + /** + * GetModelEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @instance + */ + GetModelEvaluationRequest.prototype.name = ""; /** - * Creates new PredictionService service using the specified rpc implementation. + * Creates a new GetModelEvaluationRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.PredictionService + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest instance */ - PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + GetModelEvaluationRequest.create = function create(properties) { + return new GetModelEvaluationRequest(properties); }; /** - * Callback as used by {@link google.cloud.automl.v1.PredictionService#predict}. - * @memberof google.cloud.automl.v1.PredictionService - * @typedef PredictCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.automl.v1.PredictResponse} [response] PredictResponse + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetModelEvaluationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Calls Predict. - * @function predict - * @memberof google.cloud.automl.v1.PredictionService - * @instance - * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object - * @param {google.cloud.automl.v1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { - return this.rpcCall(predict, $root.google.cloud.automl.v1.PredictRequest, $root.google.cloud.automl.v1.PredictResponse, request, callback); - }, "name", { value: "Predict" }); + GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls Predict. - * @function predict - * @memberof google.cloud.automl.v1.PredictionService + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelEvaluationRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelEvaluationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + */ + GetModelEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelEvaluationRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest * @instance - * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PredictionService; + return GetModelEvaluationRequest; })(); - v1.PredictRequest = (function() { + v1.ListModelEvaluationsRequest = (function() { /** - * Properties of a PredictRequest. + * Properties of a ListModelEvaluationsRequest. * @memberof google.cloud.automl.v1 - * @interface IPredictRequest - * @property {string|null} [name] PredictRequest name - * @property {google.cloud.automl.v1.IExamplePayload|null} [payload] PredictRequest payload - * @property {Object.|null} [params] PredictRequest params + * @interface IListModelEvaluationsRequest + * @property {string|null} [parent] ListModelEvaluationsRequest parent + * @property {string|null} [filter] ListModelEvaluationsRequest filter + * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken */ /** - * Constructs a new PredictRequest. + * Constructs a new ListModelEvaluationsRequest. * @memberof google.cloud.automl.v1 - * @classdesc Represents a PredictRequest. - * @implements IPredictRequest + * @classdesc Represents a ListModelEvaluationsRequest. + * @implements IListModelEvaluationsRequest * @constructor - * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set */ - function PredictRequest(properties) { - this.params = {}; + function ListModelEvaluationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8509,107 +22241,114 @@ } /** - * PredictRequest name. - * @member {string} name - * @memberof google.cloud.automl.v1.PredictRequest + * ListModelEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @instance */ - PredictRequest.prototype.name = ""; + ListModelEvaluationsRequest.prototype.parent = ""; /** - * PredictRequest payload. - * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} payload - * @memberof google.cloud.automl.v1.PredictRequest + * ListModelEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @instance */ - PredictRequest.prototype.payload = null; + ListModelEvaluationsRequest.prototype.filter = ""; /** - * PredictRequest params. - * @member {Object.} params - * @memberof google.cloud.automl.v1.PredictRequest + * ListModelEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @instance */ - PredictRequest.prototype.params = $util.emptyObject; + ListModelEvaluationsRequest.prototype.pageSize = 0; /** - * Creates a new PredictRequest instance using the specified properties. + * ListModelEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static - * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set - * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance */ - PredictRequest.create = function create(properties) { - return new PredictRequest(properties); + ListModelEvaluationsRequest.create = function create(properties) { + return new ListModelEvaluationsRequest(properties); }; /** - * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static - * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encode = function encode(message, writer) { + ListModelEvaluationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.payload != null && message.hasOwnProperty("payload")) - $root.google.cloud.automl.v1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.params != null && message.hasOwnProperty("params")) - for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); return writer; }; /** - * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static - * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictRequest message from the specified reader or buffer. + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictRequest.decode = function decode(reader, length) { + ListModelEvaluationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictRequest(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.payload = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 3: - reader.skip().pos++; - if (message.params === $util.emptyObject) - message.params = {}; - key = reader.string(); - reader.pos++; - message.params[key] = reader.string(); + message.filter = reader.string(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 6: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8620,147 +22359,134 @@ }; /** - * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictRequest.decodeDelimited = function decodeDelimited(reader) { + ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictRequest message. + * Verifies a ListModelEvaluationsRequest message. * @function verify - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictRequest.verify = function verify(message) { + ListModelEvaluationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.payload); - if (error) - return "payload." + error; - } - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.params[key[i]])) - return "params: string{k:string} expected"; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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 PredictRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest */ - PredictRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.PredictRequest) + ListModelEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsRequest) return object; - var message = new $root.google.cloud.automl.v1.PredictRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.automl.v1.PredictRequest.payload: object expected"); - message.payload = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.payload); - } - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.automl.v1.PredictRequest.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) - message.params[keys[i]] = String(object.params[keys[i]]); - } + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + 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 PredictRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @static - * @param {google.cloud.automl.v1.PredictRequest} message PredictRequest + * @param {google.cloud.automl.v1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictRequest.toObject = function toObject(message, options) { + ListModelEvaluationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.params = {}; if (options.defaults) { - object.name = ""; - object.payload = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.payload, options); - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = message.params[keys2[j]]; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + 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 PredictRequest to JSON. + * Converts this ListModelEvaluationsRequest to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.PredictRequest + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest * @instance * @returns {Object.} JSON object */ - PredictRequest.prototype.toJSON = function toJSON() { + ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PredictRequest; + return ListModelEvaluationsRequest; })(); - v1.PredictResponse = (function() { + v1.ListModelEvaluationsResponse = (function() { /** - * Properties of a PredictResponse. + * Properties of a ListModelEvaluationsResponse. * @memberof google.cloud.automl.v1 - * @interface IPredictResponse - * @property {Array.|null} [payload] PredictResponse payload - * @property {Object.|null} [metadata] PredictResponse metadata + * @interface IListModelEvaluationsResponse + * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation + * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken */ /** - * Constructs a new PredictResponse. + * Constructs a new ListModelEvaluationsResponse. * @memberof google.cloud.automl.v1 - * @classdesc Represents a PredictResponse. - * @implements IPredictResponse + * @classdesc Represents a ListModelEvaluationsResponse. + * @implements IListModelEvaluationsResponse * @constructor - * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set */ - function PredictResponse(properties) { - this.payload = []; - this.metadata = {}; + function ListModelEvaluationsResponse(properties) { + this.modelEvaluation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8768,97 +22494,91 @@ } /** - * PredictResponse payload. - * @member {Array.} payload - * @memberof google.cloud.automl.v1.PredictResponse + * ListModelEvaluationsResponse modelEvaluation. + * @member {Array.} modelEvaluation + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @instance */ - PredictResponse.prototype.payload = $util.emptyArray; + ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; /** - * PredictResponse metadata. - * @member {Object.} metadata - * @memberof google.cloud.automl.v1.PredictResponse + * ListModelEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @instance */ - PredictResponse.prototype.metadata = $util.emptyObject; + ListModelEvaluationsResponse.prototype.nextPageToken = ""; /** - * Creates a new PredictResponse instance using the specified properties. + * Creates a new ListModelEvaluationsResponse instance using the specified properties. * @function create - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static - * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set - * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse instance + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance */ - PredictResponse.create = function create(properties) { - return new PredictResponse(properties); + ListModelEvaluationsResponse.create = function create(properties) { + return new ListModelEvaluationsResponse(properties); }; /** - * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static - * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encode = function encode(message, writer) { + ListModelEvaluationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.payload != null && message.payload.length) - for (var i = 0; i < message.payload.length; ++i) - $root.google.cloud.automl.v1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.metadata != null && message.hasOwnProperty("metadata")) - for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.modelEvaluation != null && message.modelEvaluation.length) + for (var i = 0; i < message.modelEvaluation.length; ++i) + $root.google.cloud.automl.v1.ModelEvaluation.encode(message.modelEvaluation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static - * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PredictResponse message from the specified reader or buffer. + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decode = function decode(reader, length) { + ListModelEvaluationsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictResponse(), key; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.payload && message.payload.length)) - message.payload = []; - message.payload.push($root.google.cloud.automl.v1.AnnotationPayload.decode(reader, reader.uint32())); + if (!(message.modelEvaluation && message.modelEvaluation.length)) + message.modelEvaluation = []; + message.modelEvaluation.push($root.google.cloud.automl.v1.ModelEvaluation.decode(reader, reader.uint32())); break; case 2: - reader.skip().pos++; - if (message.metadata === $util.emptyObject) - message.metadata = {}; - key = reader.string(); - reader.pos++; - message.metadata[key] = reader.string(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -8869,127 +22589,113 @@ }; /** - * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PredictResponse.decodeDelimited = function decodeDelimited(reader) { + ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PredictResponse message. + * Verifies a ListModelEvaluationsResponse message. * @function verify - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PredictResponse.verify = function verify(message) { + ListModelEvaluationsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.payload != null && message.hasOwnProperty("payload")) { - if (!Array.isArray(message.payload)) - return "payload: array expected"; - for (var i = 0; i < message.payload.length; ++i) { - var error = $root.google.cloud.automl.v1.AnnotationPayload.verify(message.payload[i]); + if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { + if (!Array.isArray(message.modelEvaluation)) + return "modelEvaluation: array expected"; + for (var i = 0; i < message.modelEvaluation.length; ++i) { + var error = $root.google.cloud.automl.v1.ModelEvaluation.verify(message.modelEvaluation[i]); if (error) - return "payload." + error; + return "modelEvaluation." + error; } } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.metadata[key[i]])) - return "metadata: string{k:string} expected"; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse */ - PredictResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.automl.v1.PredictResponse) + ListModelEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsResponse) return object; - var message = new $root.google.cloud.automl.v1.PredictResponse(); - if (object.payload) { - if (!Array.isArray(object.payload)) - throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: array expected"); - message.payload = []; - for (var i = 0; i < object.payload.length; ++i) { - if (typeof object.payload[i] !== "object") - throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: object expected"); - message.payload[i] = $root.google.cloud.automl.v1.AnnotationPayload.fromObject(object.payload[i]); + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + if (object.modelEvaluation) { + if (!Array.isArray(object.modelEvaluation)) + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: array expected"); + message.modelEvaluation = []; + for (var i = 0; i < object.modelEvaluation.length; ++i) { + if (typeof object.modelEvaluation[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: object expected"); + message.modelEvaluation[i] = $root.google.cloud.automl.v1.ModelEvaluation.fromObject(object.modelEvaluation[i]); } } - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.automl.v1.PredictResponse.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) - message.metadata[keys[i]] = String(object.metadata[keys[i]]); - } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @static - * @param {google.cloud.automl.v1.PredictResponse} message PredictResponse + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PredictResponse.toObject = function toObject(message, options) { + ListModelEvaluationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.payload = []; - if (options.objects || options.defaults) - object.metadata = {}; - if (message.payload && message.payload.length) { - object.payload = []; - for (var j = 0; j < message.payload.length; ++j) - object.payload[j] = $root.google.cloud.automl.v1.AnnotationPayload.toObject(message.payload[j], options); - } - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = message.metadata[keys2[j]]; + object.modelEvaluation = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.modelEvaluation && message.modelEvaluation.length) { + object.modelEvaluation = []; + for (var j = 0; j < message.modelEvaluation.length; ++j) + object.modelEvaluation[j] = $root.google.cloud.automl.v1.ModelEvaluation.toObject(message.modelEvaluation[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this PredictResponse to JSON. + * Converts this ListModelEvaluationsResponse to JSON. * @function toJSON - * @memberof google.cloud.automl.v1.PredictResponse + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse * @instance * @returns {Object.} JSON object */ - PredictResponse.prototype.toJSON = function toJSON() { + ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PredictResponse; + return ListModelEvaluationsResponse; })(); return v1; @@ -21090,6 +34796,8 @@ * Properties of a TablesModelMetadata. * @memberof google.cloud.automl.v1beta1 * @interface ITablesModelMetadata + * @property {number|null} [optimizationObjectiveRecallValue] TablesModelMetadata optimizationObjectiveRecallValue + * @property {number|null} [optimizationObjectivePrecisionValue] TablesModelMetadata optimizationObjectivePrecisionValue * @property {google.cloud.automl.v1beta1.IColumnSpec|null} [targetColumnSpec] TablesModelMetadata targetColumnSpec * @property {Array.|null} [inputFeatureColumnSpecs] TablesModelMetadata inputFeatureColumnSpecs * @property {string|null} [optimizationObjective] TablesModelMetadata optimizationObjective @@ -21116,6 +34824,22 @@ this[keys[i]] = properties[keys[i]]; } + /** + * TablesModelMetadata optimizationObjectiveRecallValue. + * @member {number} optimizationObjectiveRecallValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectiveRecallValue = 0; + + /** + * TablesModelMetadata optimizationObjectivePrecisionValue. + * @member {number} optimizationObjectivePrecisionValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectivePrecisionValue = 0; + /** * TablesModelMetadata targetColumnSpec. * @member {google.cloud.automl.v1beta1.IColumnSpec|null|undefined} targetColumnSpec @@ -21172,6 +34896,20 @@ */ TablesModelMetadata.prototype.disableEarlyStopping = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TablesModelMetadata additionalOptimizationObjectiveConfig. + * @member {"optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"|undefined} additionalOptimizationObjectiveConfig + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + Object.defineProperty(TablesModelMetadata.prototype, "additionalOptimizationObjectiveConfig", { + get: $util.oneOfGetter($oneOfFields = ["optimizationObjectiveRecallValue", "optimizationObjectivePrecisionValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new TablesModelMetadata instance using the specified properties. * @function create @@ -21212,6 +34950,10 @@ writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disableEarlyStopping); + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) + writer.uint32(/* id 17, wireType 5 =*/141).float(message.optimizationObjectiveRecallValue); + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) + writer.uint32(/* id 18, wireType 5 =*/149).float(message.optimizationObjectivePrecisionValue); return writer; }; @@ -21246,6 +34988,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 17: + message.optimizationObjectiveRecallValue = reader.float(); + break; + case 18: + message.optimizationObjectivePrecisionValue = reader.float(); + break; case 2: message.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32()); break; @@ -21306,6 +35054,19 @@ TablesModelMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectiveRecallValue !== "number") + return "optimizationObjectiveRecallValue: number expected"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + if (properties.additionalOptimizationObjectiveConfig === 1) + return "additionalOptimizationObjectiveConfig: multiple values"; + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectivePrecisionValue !== "number") + return "optimizationObjectivePrecisionValue: number expected"; + } if (message.targetColumnSpec != null && message.hasOwnProperty("targetColumnSpec")) { var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.targetColumnSpec); if (error) @@ -21356,6 +35117,10 @@ if (object instanceof $root.google.cloud.automl.v1beta1.TablesModelMetadata) return object; var message = new $root.google.cloud.automl.v1beta1.TablesModelMetadata(); + if (object.optimizationObjectiveRecallValue != null) + message.optimizationObjectiveRecallValue = Number(object.optimizationObjectiveRecallValue); + if (object.optimizationObjectivePrecisionValue != null) + message.optimizationObjectivePrecisionValue = Number(object.optimizationObjectivePrecisionValue); if (object.targetColumnSpec != null) { if (typeof object.targetColumnSpec !== "object") throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.targetColumnSpec: object expected"); @@ -21464,6 +35229,16 @@ object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) object.disableEarlyStopping = message.disableEarlyStopping; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + object.optimizationObjectiveRecallValue = options.json && !isFinite(message.optimizationObjectiveRecallValue) ? String(message.optimizationObjectiveRecallValue) : message.optimizationObjectiveRecallValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectiveRecallValue"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + object.optimizationObjectivePrecisionValue = options.json && !isFinite(message.optimizationObjectivePrecisionValue) ? String(message.optimizationObjectivePrecisionValue) : message.optimizationObjectivePrecisionValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectivePrecisionValue"; + } return object; }; @@ -34588,6 +48363,8 @@ * @property {number|Long|null} [trainCost] ImageClassificationModelMetadata trainCost * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount */ /** @@ -34645,6 +48422,22 @@ */ ImageClassificationModelMetadata.prototype.modelType = ""; + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** * Creates a new ImageClassificationModelMetadata instance using the specified properties. * @function create @@ -34679,6 +48472,10 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); if (message.modelType != null && message.hasOwnProperty("modelType")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); return writer; }; @@ -34728,6 +48525,12 @@ case 7: message.modelType = reader.string(); break; + case 13: + message.nodeQps = reader.double(); + break; + case 14: + message.nodeCount = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -34778,6 +48581,12 @@ if (message.modelType != null && message.hasOwnProperty("modelType")) if (!$util.isString(message.modelType)) return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; return null; }; @@ -34817,6 +48626,17 @@ message.stopReason = String(object.stopReason); if (object.modelType != null) message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); return message; }; @@ -34847,6 +48667,12 @@ object.trainCost = options.longs === String ? "0" : 0; object.stopReason = ""; object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; } if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) object.baseModelId = message.baseModelId; @@ -34864,6 +48690,13 @@ object.stopReason = message.stopReason; if (message.modelType != null && message.hasOwnProperty("modelType")) object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; return object; }; @@ -35834,6 +49667,7 @@ * Properties of a TextClassificationModelMetadata. * @memberof google.cloud.automl.v1beta1 * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType */ /** @@ -35851,6 +49685,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + /** * Creates a new TextClassificationModelMetadata instance using the specified properties. * @function create @@ -35875,6 +49717,8 @@ TextClassificationModelMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); return writer; }; @@ -35909,6 +49753,9 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.classificationType = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -35944,6 +49791,15 @@ TextClassificationModelMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -35958,7 +49814,22 @@ TextClassificationModelMetadata.fromObject = function fromObject(object) { if (object instanceof $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata) return object; - return new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + var message = new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + switch (object.classificationType) { + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; }; /** @@ -35970,8 +49841,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextClassificationModelMetadata.toObject = function toObject() { - return {}; + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; }; /** @@ -43341,6 +57219,521 @@ */ var api = {}; + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + api.Http = (function() { /** @@ -44245,6 +58638,28 @@ return CustomHttpPattern; })(); + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + return api; })(); @@ -49084,6 +63499,7 @@ * @property {boolean|null} [deprecated] MessageOptions deprecated * @property {boolean|null} [mapEntry] MessageOptions mapEntry * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** @@ -49142,6 +63558,14 @@ */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + /** * Creates a new MessageOptions instance using the specified properties. * @function create @@ -49177,6 +63601,8 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -49228,6 +63654,9 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -49284,6 +63713,11 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } return null; }; @@ -49317,6 +63751,11 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } return message; }; @@ -49340,6 +63779,7 @@ object.noStandardDescriptorAccessor = false; object.deprecated = false; object.mapEntry = false; + object[".google.api.resource"] = null; } if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; @@ -49354,6 +63794,8 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); return object; }; @@ -49384,6 +63826,8 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior */ /** @@ -49396,6 +63840,7 @@ */ function FieldOptions(properties) { this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49458,6 +63903,22 @@ */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -49497,6 +63958,14 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -49554,6 +64023,19 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -49628,6 +64110,27 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } return null; }; @@ -49689,6 +64192,44 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + } + } return message; }; @@ -49705,8 +64246,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; object.packed = false; @@ -49714,6 +64257,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -49732,6 +64276,13 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); return object; }; @@ -52757,6 +67308,230 @@ return GeneratedCodeInfo; })(); + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + protobuf.Any = (function() { /** @@ -54000,230 +68775,6 @@ return ListValue; })(); - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Timestamp; - })(); - protobuf.Empty = (function() { /** @@ -54590,272 +69141,6 @@ return protobuf; })(); - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Status; - })(); - - return rpc; - })(); - google.longrunning = (function() { /** @@ -56857,6 +71142,272 @@ return longrunning; })(); + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + return google; })(); diff --git a/packages/google-cloud-automl/protos/protos.json b/packages/google-cloud-automl/protos/protos.json index f65d60764a8..eb395fe18b0 100644 --- a/packages/google-cloud-automl/protos/protos.json +++ b/packages/google-cloud-automl/protos/protos.json @@ -8,15 +8,1330 @@ "nested": { "v1": { "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/automl/v1;automl", "csharp_namespace": "Google.Cloud.AutoML.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/automl/v1;automl", "java_multiple_files": true, - "java_outer_classname": "PredictionServiceProto", "java_package": "com.google.cloud.automl.v1", "php_namespace": "Google\\Cloud\\AutoML\\V1", - "ruby_package": "Google::Cloud::AutoML::V1" + "ruby_package": "Google::Cloud::AutoML::V1", + "java_outer_classname": "AutoMlProto" }, "nested": { + "OperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "deleteDetails", + "deployModelDetails", + "undeployModelDetails", + "createModelDetails", + "createDatasetDetails", + "importDataDetails", + "batchPredictDetails", + "exportDataDetails", + "exportModelDetails" + ] + } + }, + "fields": { + "deleteDetails": { + "type": "DeleteOperationMetadata", + "id": 8 + }, + "deployModelDetails": { + "type": "DeployModelOperationMetadata", + "id": 24 + }, + "undeployModelDetails": { + "type": "UndeployModelOperationMetadata", + "id": 25 + }, + "createModelDetails": { + "type": "CreateModelOperationMetadata", + "id": 10 + }, + "createDatasetDetails": { + "type": "CreateDatasetOperationMetadata", + "id": 30 + }, + "importDataDetails": { + "type": "ImportDataOperationMetadata", + "id": 15 + }, + "batchPredictDetails": { + "type": "BatchPredictOperationMetadata", + "id": 16 + }, + "exportDataDetails": { + "type": "ExportDataOperationMetadata", + "id": 21 + }, + "exportModelDetails": { + "type": "ExportModelOperationMetadata", + "id": 22 + }, + "progressPercent": { + "type": "int32", + "id": 13 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DeleteOperationMetadata": { + "fields": {} + }, + "DeployModelOperationMetadata": { + "fields": {} + }, + "UndeployModelOperationMetadata": { + "fields": {} + }, + "CreateDatasetOperationMetadata": { + "fields": {} + }, + "CreateModelOperationMetadata": { + "fields": {} + }, + "ImportDataOperationMetadata": { + "fields": {} + }, + "ExportDataOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportDataOutputInfo", + "id": 1 + } + }, + "nested": { + "ExportDataOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "BatchPredictOperationMetadata": { + "fields": { + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 1 + }, + "outputInfo": { + "type": "BatchPredictOutputInfo", + "id": 2 + } + }, + "nested": { + "BatchPredictOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ExportModelOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportModelOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportModelOutputInfo": { + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "Dataset": { + "oneofs": { + "datasetMetadata": { + "oneof": [ + "translationDatasetMetadata", + "imageClassificationDatasetMetadata", + "textClassificationDatasetMetadata", + "imageObjectDetectionDatasetMetadata", + "textExtractionDatasetMetadata", + "textSentimentDatasetMetadata" + ] + } + }, + "fields": { + "translationDatasetMetadata": { + "type": "TranslationDatasetMetadata", + "id": 23 + }, + "imageClassificationDatasetMetadata": { + "type": "ImageClassificationDatasetMetadata", + "id": 24 + }, + "textClassificationDatasetMetadata": { + "type": "TextClassificationDatasetMetadata", + "id": 25 + }, + "imageObjectDetectionDatasetMetadata": { + "type": "ImageObjectDetectionDatasetMetadata", + "id": 26 + }, + "textExtractionDatasetMetadata": { + "type": "TextExtractionDatasetMetadata", + "id": 28 + }, + "textSentimentDatasetMetadata": { + "type": "TextSentimentDatasetMetadata", + "id": 30 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "exampleCount": { + "type": "int32", + "id": 21 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14 + }, + "etag": { + "type": "string", + "id": 17 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 39 + } + } + }, + "ImageClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "ImageObjectDetectionDatasetMetadata": { + "fields": {} + }, + "ImageClassificationModelMetadata": { + "fields": { + "baseModelId": { + "type": "string", + "id": 1 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 16 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 17 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "modelType": { + "type": "string", + "id": 7 + }, + "nodeQps": { + "type": "double", + "id": 13 + }, + "nodeCount": { + "type": "int64", + "id": 14 + } + } + }, + "ImageObjectDetectionModelMetadata": { + "fields": { + "modelType": { + "type": "string", + "id": 1 + }, + "nodeCount": { + "type": "int64", + "id": 3 + }, + "nodeQps": { + "type": "double", + "id": 4 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7 + } + } + }, + "ImageClassificationModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "ImageObjectDetectionModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "AnnotationSpec": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "exampleCount": { + "type": "int32", + "id": 9 + } + } + }, + "ClassificationType": { + "values": { + "CLASSIFICATION_TYPE_UNSPECIFIED": 0, + "MULTICLASS": 1, + "MULTILABEL": 2 + } + }, + "ClassificationAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + } + } + }, + "ClassificationEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "auRoc": { + "type": "float", + "id": 6 + }, + "logLoss": { + "type": "float", + "id": 7 + }, + "confidenceMetricsEntry": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 4 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "positionThreshold": { + "type": "int32", + "id": 14 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "falsePositiveRate": { + "type": "float", + "id": 8 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "falsePositiveRateAt1": { + "type": "float", + "id": 9 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "truePositiveCount": { + "type": "int64", + "id": 10 + }, + "falsePositiveCount": { + "type": "int64", + "id": 11 + }, + "falseNegativeCount": { + "type": "int64", + "id": 12 + }, + "trueNegativeCount": { + "type": "int64", + "id": 13 + } + } + }, + "ConfusionMatrix": { + "fields": { + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "row": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "exampleCount": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + } + } + } + } + }, + "TextClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "TextClassificationModelMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } + }, + "TextExtractionDatasetMetadata": { + "fields": {} + }, + "TextExtractionModelMetadata": { + "fields": {} + }, + "TextSentimentDatasetMetadata": { + "fields": { + "sentimentMax": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentModelMetadata": { + "fields": {} + }, + "TranslationDatasetMetadata": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranslationEvaluationMetrics": { + "fields": { + "bleuScore": { + "type": "double", + "id": 1 + }, + "baseBleuScore": { + "type": "double", + "id": 2 + } + } + }, + "TranslationModelMetadata": { + "fields": { + "baseModel": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslationAnnotation": { + "fields": { + "translatedContent": { + "type": "TextSnippet", + "id": 1 + } + } + }, + "Image": { + "oneofs": { + "data": { + "oneof": [ + "imageBytes" + ] + } + }, + "fields": { + "imageBytes": { + "type": "bytes", + "id": 1 + }, + "thumbnailUri": { + "type": "string", + "id": 4 + } + } + }, + "TextSnippet": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "contentUri": { + "type": "string", + "id": 4 + } + } + }, + "DocumentDimensions": { + "fields": { + "unit": { + "type": "DocumentDimensionUnit", + "id": 1 + }, + "width": { + "type": "float", + "id": 2 + }, + "height": { + "type": "float", + "id": 3 + } + }, + "nested": { + "DocumentDimensionUnit": { + "values": { + "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": 0, + "INCH": 1, + "CENTIMETER": 2, + "POINT": 3 + } + } + } + }, + "Document": { + "fields": { + "inputConfig": { + "type": "DocumentInputConfig", + "id": 1 + }, + "documentText": { + "type": "TextSnippet", + "id": 2 + }, + "layout": { + "rule": "repeated", + "type": "Layout", + "id": 3 + }, + "documentDimensions": { + "type": "DocumentDimensions", + "id": 4 + }, + "pageCount": { + "type": "int32", + "id": 5 + } + }, + "nested": { + "Layout": { + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "textSegmentType": { + "type": "TextSegmentType", + "id": 4 + } + }, + "nested": { + "TextSegmentType": { + "values": { + "TEXT_SEGMENT_TYPE_UNSPECIFIED": 0, + "TOKEN": 1, + "PARAGRAPH": 2, + "FORM_FIELD": 3, + "FORM_FIELD_NAME": 4, + "FORM_FIELD_CONTENTS": 5, + "TABLE": 6, + "TABLE_HEADER": 7, + "TABLE_ROW": 8, + "TABLE_CELL": 9 + } + } + } + } + } + }, + "ExamplePayload": { + "oneofs": { + "payload": { + "oneof": [ + "image", + "textSnippet", + "document" + ] + } + }, + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "textSnippet": { + "type": "TextSnippet", + "id": 2 + }, + "document": { + "type": "Document", + "id": 4 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DocumentInputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchPredictOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ModelExportOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelFormat": { + "type": "string", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TextSegment": { + "fields": { + "content": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "int64", + "id": 1 + }, + "endOffset": { + "type": "int64", + "id": 2 + } + } + }, + "Model": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Model", + "(google.api.resource).pattern": "projects/{project_id}/locations/{location_id}/models/{model_id}" + }, + "oneofs": { + "modelMetadata": { + "oneof": [ + "translationModelMetadata", + "imageClassificationModelMetadata", + "textClassificationModelMetadata", + "imageObjectDetectionModelMetadata", + "textExtractionModelMetadata", + "textSentimentModelMetadata" + ] + } + }, + "fields": { + "translationModelMetadata": { + "type": "TranslationModelMetadata", + "id": 15 + }, + "imageClassificationModelMetadata": { + "type": "ImageClassificationModelMetadata", + "id": 13 + }, + "textClassificationModelMetadata": { + "type": "TextClassificationModelMetadata", + "id": 14 + }, + "imageObjectDetectionModelMetadata": { + "type": "ImageObjectDetectionModelMetadata", + "id": 20 + }, + "textExtractionModelMetadata": { + "type": "TextExtractionModelMetadata", + "id": 19 + }, + "textSentimentModelMetadata": { + "type": "TextSentimentModelMetadata", + "id": 22 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "datasetId": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "deploymentState": { + "type": "DeploymentState", + "id": 8 + }, + "etag": { + "type": "string", + "id": 10 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 34 + } + }, + "nested": { + "DeploymentState": { + "values": { + "DEPLOYMENT_STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "UNDEPLOYED": 2 + } + } + } + }, + "ModelEvaluation": { + "oneofs": { + "metrics": { + "oneof": [ + "classificationEvaluationMetrics", + "translationEvaluationMetrics", + "imageObjectDetectionEvaluationMetrics", + "textSentimentEvaluationMetrics", + "textExtractionEvaluationMetrics" + ] + } + }, + "fields": { + "classificationEvaluationMetrics": { + "type": "ClassificationEvaluationMetrics", + "id": 8 + }, + "translationEvaluationMetrics": { + "type": "TranslationEvaluationMetrics", + "id": 9 + }, + "imageObjectDetectionEvaluationMetrics": { + "type": "ImageObjectDetectionEvaluationMetrics", + "id": 12 + }, + "textSentimentEvaluationMetrics": { + "type": "TextSentimentEvaluationMetrics", + "id": 11 + }, + "textExtractionEvaluationMetrics": { + "type": "TextExtractionEvaluationMetrics", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotationSpecId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "evaluatedExampleCount": { + "type": "int32", + "id": 6 + } + } + }, + "ImageObjectDetectionAnnotation": { + "fields": { + "boundingBox": { + "type": "BoundingPoly", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "BoundingBoxMetricsEntry": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + }, + "meanAveragePrecision": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + } + } + } + } + }, + "ImageObjectDetectionEvaluationMetrics": { + "fields": { + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 1 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 2 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 3 + } + } + }, + "TextExtractionAnnotation": { + "oneofs": { + "annotation": { + "oneof": [ + "textSegment" + ] + } + }, + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 3 + }, + "score": { + "type": "float", + "id": 1 + } + } + }, + "TextExtractionEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 2 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 3 + }, + "precision": { + "type": "float", + "id": 4 + }, + "f1Score": { + "type": "float", + "id": 5 + } + } + } + } + }, + "TextSentimentAnnotation": { + "fields": { + "sentiment": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentEvaluationMetrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "meanAbsoluteError": { + "type": "float", + "id": 4 + }, + "meanSquaredError": { + "type": "float", + "id": 5 + }, + "linearKappa": { + "type": "float", + "id": 6 + }, + "quadraticKappa": { + "type": "float", + "id": 7 + }, + "confusionMatrix": { + "type": "ClassificationEvaluationMetrics.ConfusionMatrix", + "id": 8 + } + } + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:predict", + "(google.api.http).body": "*" + } + }, + "BatchPredict": { + "requestType": "BatchPredictRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:batchPredict", + "(google.api.http).body": "*" + } + } + } + }, + "PredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "payload": { + "type": "ExamplePayload", + "id": 2 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PredictResponse": { + "fields": { + "payload": { + "rule": "repeated", + "type": "AnnotationPayload", + "id": 1 + }, + "preprocessedInput": { + "type": "ExamplePayload", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 3 + }, + "outputConfig": { + "type": "BatchPredictOutputConfig", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "BatchPredictResult": { + "fields": { + "metadata": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AnnotationPayload": { + "oneofs": { + "detail": { + "oneof": [ + "translation", + "classification", + "imageObjectDetection", + "textExtraction", + "textSentiment" + ] + } + }, + "fields": { + "translation": { + "type": "TranslationAnnotation", + "id": 2 + }, + "classification": { + "type": "ClassificationAnnotation", + "id": 3 + }, + "imageObjectDetection": { + "type": "ImageObjectDetectionAnnotation", + "id": 4 + }, + "textExtraction": { + "type": "TextExtractionAnnotation", + "id": 6 + }, + "textSentiment": { + "type": "TextSentimentAnnotation", + "id": 7 + }, + "annotationSpecId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, "AutoMl": { "options": { "(google.api.default_host)": "automl.googleapis.com", @@ -76,6 +1391,13 @@ "(google.api.http).body": "*" } }, + "GetAnnotationSpec": { + "requestType": "GetAnnotationSpecRequest", + "responseType": "google.cloud.automl.v1.AnnotationSpec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + } + }, "CreateModel": { "requestType": "CreateModelRequest", "responseType": "google.longrunning.Operation", @@ -113,6 +1435,30 @@ "(google.api.http).body": "model" } }, + "DeployModel": { + "requestType": "DeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:deploy", + "(google.api.http).body": "*" + } + }, + "UndeployModel": { + "requestType": "UndeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:undeploy", + "(google.api.http).body": "*" + } + }, + "ExportModel": { + "requestType": "ExportModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:export", + "(google.api.http).body": "*" + } + }, "GetModelEvaluation": { "requestType": "GetModelEvaluationRequest", "responseType": "ModelEvaluation", @@ -130,176 +1476,18 @@ } }, "CreateDatasetRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "dataset": { - "type": "Dataset", - "id": 2 - } - } - }, - "GetDatasetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListDatasetsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 6 - } - } - }, - "ListDatasetsResponse": { - "fields": { - "datasets": { - "rule": "repeated", - "type": "Dataset", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "UpdateDatasetRequest": { - "fields": { - "dataset": { - "type": "Dataset", - "id": 1 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteDatasetRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ImportDataRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputConfig": { - "type": "InputConfig", - "id": 3 - } - } - }, - "ExportDataRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "outputConfig": { - "type": "OutputConfig", - "id": 3 - } - } - }, - "CreateModelRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "model": { - "type": "Model", - "id": 4 - } - } - }, - "GetModelRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListModelsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 6 - } - } - }, - "ListModelsResponse": { - "fields": { - "model": { - "rule": "repeated", - "type": "Model", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteModelRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "UpdateModelRequest": { - "fields": { - "model": { - "type": "Model", + "fields": { + "parent": { + "type": "string", "id": 1 }, - "updateMask": { - "type": "google.protobuf.FieldMask", + "dataset": { + "type": "Dataset", "id": 2 } } }, - "GetModelEvaluationRequest": { + "GetDatasetRequest": { "fields": { "name": { "type": "string", @@ -307,7 +1495,7 @@ } } }, - "ListModelEvaluationsRequest": { + "ListDatasetsRequest": { "fields": { "parent": { "type": "string", @@ -327,11 +1515,11 @@ } } }, - "ListModelEvaluationsResponse": { + "ListDatasetsResponse": { "fields": { - "modelEvaluation": { + "datasets": { "rule": "repeated", - "type": "ModelEvaluation", + "type": "Dataset", "id": 1 }, "nextPageToken": { @@ -340,365 +1528,211 @@ } } }, - "AnnotationPayload": { - "oneofs": { - "detail": { - "oneof": [ - "translation" - ] - } - }, - "fields": { - "translation": { - "type": "TranslationAnnotation", - "id": 2 - } - } - }, - "TranslationDatasetMetadata": { + "UpdateDatasetRequest": { "fields": { - "sourceLanguageCode": { - "type": "string", + "dataset": { + "type": "Dataset", "id": 1 }, - "targetLanguageCode": { - "type": "string", + "updateMask": { + "type": "google.protobuf.FieldMask", "id": 2 } } }, - "TranslationEvaluationMetrics": { + "DeleteDatasetRequest": { "fields": { - "bleuScore": { - "type": "double", + "name": { + "type": "string", "id": 1 - }, - "baseBleuScore": { - "type": "double", - "id": 2 } } }, - "TranslationModelMetadata": { + "ImportDataRequest": { "fields": { - "baseModel": { + "name": { "type": "string", "id": 1 }, - "sourceLanguageCode": { - "type": "string", - "id": 2 - }, - "targetLanguageCode": { - "type": "string", + "inputConfig": { + "type": "InputConfig", "id": 3 } } }, - "TranslationAnnotation": { - "fields": { - "translatedContent": { - "type": "TextSnippet", - "id": 1 - } - } - }, - "TextSnippet": { + "ExportDataRequest": { "fields": { - "content": { + "name": { "type": "string", "id": 1 }, - "mimeType": { - "type": "string", - "id": 2 - }, - "contentUri": { - "type": "string", - "id": 4 - } - } - }, - "ExamplePayload": { - "oneofs": { - "payload": { - "oneof": [ - "textSnippet" - ] - } - }, - "fields": { - "textSnippet": { - "type": "TextSnippet", - "id": 2 + "outputConfig": { + "type": "OutputConfig", + "id": 3 } } }, - "InputConfig": { - "oneofs": { - "source": { - "oneof": [ - "gcsSource" - ] - } - }, + "GetAnnotationSpecRequest": { "fields": { - "gcsSource": { - "type": "GcsSource", - "id": 1 - }, - "params": { - "keyType": "string", + "name": { "type": "string", - "id": 2 - } - } - }, - "OutputConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsDestination" - ] - } - }, - "fields": { - "gcsDestination": { - "type": "GcsDestination", "id": 1 } } }, - "GcsSource": { + "CreateModelRequest": { "fields": { - "inputUris": { - "rule": "repeated", + "parent": { "type": "string", "id": 1 + }, + "model": { + "type": "Model", + "id": 4 } } }, - "GcsDestination": { + "GetModelRequest": { "fields": { - "outputUriPrefix": { + "name": { "type": "string", "id": 1 } } }, - "Dataset": { - "oneofs": { - "datasetMetadata": { - "oneof": [ - "translationDatasetMetadata" - ] - } - }, + "ListModelsRequest": { "fields": { - "translationDatasetMetadata": { - "type": "TranslationDatasetMetadata", - "id": 23 - }, - "name": { + "parent": { "type": "string", "id": 1 }, - "displayName": { - "type": "string", - "id": 2 - }, - "description": { + "filter": { "type": "string", "id": 3 }, - "exampleCount": { + "pageSize": { "type": "int32", - "id": 21 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 14 - }, - "etag": { - "type": "string", - "id": 17 + "id": 4 }, - "labels": { - "keyType": "string", + "pageToken": { "type": "string", - "id": 39 + "id": 6 } } }, - "Model": { - "oneofs": { - "modelMetadata": { - "oneof": [ - "translationModelMetadata" - ] - } - }, + "ListModelsResponse": { "fields": { - "translationModelMetadata": { - "type": "TranslationModelMetadata", - "id": 15 - }, - "name": { - "type": "string", + "model": { + "rule": "repeated", + "type": "Model", "id": 1 }, - "displayName": { + "nextPageToken": { "type": "string", "id": 2 - }, - "datasetId": { - "type": "string", - "id": 3 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - }, - "deploymentState": { - "type": "DeploymentState", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 34 - } - }, - "nested": { - "DeploymentState": { - "values": { - "DEPLOYMENT_STATE_UNSPECIFIED": 0, - "DEPLOYED": 1, - "UNDEPLOYED": 2 - } } } }, - "ModelEvaluation": { - "oneofs": { - "metrics": { - "oneof": [ - "translationEvaluationMetrics" - ] - } - }, + "DeleteModelRequest": { "fields": { - "translationEvaluationMetrics": { - "type": "TranslationEvaluationMetrics", - "id": 9 - }, "name": { "type": "string", "id": 1 + } + } + }, + "UpdateModelRequest": { + "fields": { + "model": { + "type": "Model", + "id": 1 }, - "annotationSpecId": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "evaluatedExampleCount": { - "type": "int32", - "id": 6 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 } } }, - "OperationMetadata": { + "DeployModelRequest": { "oneofs": { - "details": { + "modelDeploymentMetadata": { "oneof": [ - "deleteDetails", - "createModelDetails" + "imageObjectDetectionModelDeploymentMetadata", + "imageClassificationModelDeploymentMetadata" ] } }, "fields": { - "deleteDetails": { - "type": "DeleteOperationMetadata", - "id": 8 - }, - "createModelDetails": { - "type": "CreateModelOperationMetadata", - "id": 10 - }, - "progressPercent": { - "type": "int32", - "id": 13 - }, - "partialFailures": { - "rule": "repeated", - "type": "google.rpc.Status", + "imageObjectDetectionModelDeploymentMetadata": { + "type": "ImageObjectDetectionModelDeploymentMetadata", "id": 2 }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "imageClassificationModelDeploymentMetadata": { + "type": "ImageClassificationModelDeploymentMetadata", "id": 4 + }, + "name": { + "type": "string", + "id": 1 } } }, - "DeleteOperationMetadata": { - "fields": {} - }, - "CreateModelOperationMetadata": { - "fields": {} - }, - "PredictionService": { - "options": { - "(google.api.default_host)": "automl.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "Predict": { - "requestType": "PredictRequest", - "responseType": "PredictResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:predict", - "(google.api.http).body": "*" - } + "UndeployModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 } } }, - "PredictRequest": { + "ExportModelRequest": { "fields": { "name": { "type": "string", "id": 1 }, - "payload": { - "type": "ExamplePayload", - "id": 2 + "outputConfig": { + "type": "ModelExportOutputConfig", + "id": 3 + } + } + }, + "GetModelEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListModelEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 }, - "params": { - "keyType": "string", + "filter": { "type": "string", "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 } } }, - "PredictResponse": { + "ListModelEvaluationsResponse": { "fields": { - "payload": { + "modelEvaluation": { "rule": "repeated", - "type": "AnnotationPayload", + "type": "ModelEvaluation", "id": 1 }, - "metadata": { - "keyType": "string", + "nextPageToken": { "type": "string", "id": 2 } @@ -1678,7 +2712,23 @@ } }, "TablesModelMetadata": { + "oneofs": { + "additionalOptimizationObjectiveConfig": { + "oneof": [ + "optimizationObjectiveRecallValue", + "optimizationObjectivePrecisionValue" + ] + } + }, "fields": { + "optimizationObjectiveRecallValue": { + "type": "float", + "id": 17 + }, + "optimizationObjectivePrecisionValue": { + "type": "float", + "id": 18 + }, "targetColumnSpec": { "type": "ColumnSpec", "id": 2 @@ -2687,6 +3737,14 @@ "modelType": { "type": "string", "id": 7 + }, + "nodeQps": { + "type": "double", + "id": 13 + }, + "nodeCount": { + "type": "int64", + "id": 14 } } }, @@ -2743,7 +3801,12 @@ } }, "TextClassificationModelMetadata": { - "fields": {} + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } }, "TextExtractionDatasetMetadata": { "fields": {} @@ -3268,14 +4331,66 @@ }, "api": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, "java_outer_classname": "ClientProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true + "objc_class_prefix": "GAPI" }, "nested": { + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -3363,6 +4478,22 @@ } } }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, "methodSignature": { "rule": "repeated", "type": "string", @@ -4272,6 +5403,18 @@ } } }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "Any": { "fields": { "type_url": { @@ -4359,18 +5502,6 @@ } } }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, "Empty": { "fields": {} }, @@ -4385,34 +5516,6 @@ } } }, - "rpc": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, "longrunning": { "options": { "cc_enable_arenas": true, @@ -4580,6 +5683,34 @@ } } } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } } } } diff --git a/packages/google-cloud-automl/samples/README.md b/packages/google-cloud-automl/samples/README.md index e4f9cc1de74..a7af3b8d300 100644 --- a/packages/google-cloud-automl/samples/README.md +++ b/packages/google-cloud-automl/samples/README.md @@ -13,7 +13,6 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Quickstart](#quickstart) - * [Set Endpoint](#setEndpoint) ## Before you begin @@ -35,22 +34,6 @@ __Usage:__ `node quickstart.js` ------ - - - - -### Set Endpoint - -View the [source code](https://github.com/googleapis/nodejs-automl/blob/master/samples/beta/setEndpoint.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-automl&page=editor&open_in_editor=samples/beta/setEndpoint.js,samples/README.md) - -__Usage:__ - - -`node setEndpoint.js` - diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client.js b/packages/google-cloud-automl/src/v1/auto_ml_client.js index 864d11fca43..d4fc80672cb 100644 --- a/packages/google-cloud-automl/src/v1/auto_ml_client.js +++ b/packages/google-cloud-automl/src/v1/auto_ml_client.js @@ -138,6 +138,9 @@ class AutoMlClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { + annotationSpecPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), datasetPathTemplate: new gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}' ), @@ -215,6 +218,20 @@ class AutoMlClient { const deleteModelMetadata = protoFilesRoot.lookup( 'google.cloud.automl.v1.OperationMetadata' ); + const deployModelResponse = protoFilesRoot.lookup('google.protobuf.Empty'); + const deployModelMetadata = protoFilesRoot.lookup( + 'google.cloud.automl.v1.OperationMetadata' + ); + const undeployModelResponse = protoFilesRoot.lookup( + 'google.protobuf.Empty' + ); + const undeployModelMetadata = protoFilesRoot.lookup( + 'google.cloud.automl.v1.OperationMetadata' + ); + const exportModelResponse = protoFilesRoot.lookup('google.protobuf.Empty'); + const exportModelMetadata = protoFilesRoot.lookup( + 'google.cloud.automl.v1.OperationMetadata' + ); this._descriptors.longrunning = { createDataset: new gaxModule.LongrunningDescriptor( @@ -247,6 +264,21 @@ class AutoMlClient { deleteModelResponse.decode.bind(deleteModelResponse), deleteModelMetadata.decode.bind(deleteModelMetadata) ), + deployModel: new gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata) + ), + undeployModel: new gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata) + ), + exportModel: new gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata) + ), }; // Put together the default options sent with requests. @@ -281,11 +313,15 @@ class AutoMlClient { 'deleteDataset', 'importData', 'exportData', + 'getAnnotationSpec', 'createModel', 'getModel', 'updateModel', 'listModels', 'deleteModel', + 'deployModel', + 'undeployModel', + 'exportModel', 'getModelEvaluation', 'listModelEvaluations', ]; @@ -597,8 +633,8 @@ class AutoMlClient { * An expression for filtering the results of the request. * * * `dataset_metadata` - for existence of the case (e.g. - * image_classification_dataset_metadata:*). - * Some examples of using the filter are: + * image_classification_dataset_metadata:*). Some examples of + * using the filter are: * * * `translation_dataset_metadata:*` --> The dataset has * translation_dataset_metadata. @@ -718,8 +754,8 @@ class AutoMlClient { * An expression for filtering the results of the request. * * * `dataset_metadata` - for existence of the case (e.g. - * image_classification_dataset_metadata:*). - * Some examples of using the filter are: + * image_classification_dataset_metadata:*). Some examples of + * using the filter are: * * * `translation_dataset_metadata:*` --> The dataset has * translation_dataset_metadata. @@ -1101,6 +1137,60 @@ class AutoMlClient { return this._innerApiCalls.exportData(request, options, callback); } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource name of the annotation spec to retrieve. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 [AnnotationSpec]{@link google.cloud.automl.v1.AnnotationSpec}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnnotationSpec]{@link google.cloud.automl.v1.AnnotationSpec}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const automl = require('automl.v1'); + * + * const client = new automl.v1.AutoMlClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.annotationSpecPath('[PROJECT]', '[LOCATION]', '[DATASET]', '[ANNOTATION_SPEC]'); + * client.getAnnotationSpec({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getAnnotationSpec(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.getAnnotationSpec(request, options, callback); + } + /** * Creates a model. * Returns a Model in the response @@ -1352,7 +1442,7 @@ class AutoMlClient { * An expression for filtering the results of the request. * * * `model_metadata` - for existence of the case (e.g. - * video_classification_model_metadata:*). + * image_classification_model_metadata:*). * * `dataset_id` - for = or !=. Some examples of using the filter are: * * * `image_classification_model_metadata:*` --> The model has @@ -1474,7 +1564,7 @@ class AutoMlClient { * An expression for filtering the results of the request. * * * `model_metadata` - for existence of the case (e.g. - * video_classification_model_metadata:*). + * image_classification_model_metadata:*). * * `dataset_id` - for = or !=. Some examples of using the filter are: * * * `image_classification_model_metadata:*` --> The model has @@ -1620,6 +1710,350 @@ class AutoMlClient { return this._innerApiCalls.deleteModel(request, options, callback); } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * + * node_number) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection; all other + * domains manage deployment automatically. + * + * Returns an empty response in the + * response field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the model to deploy. + * @param {Object} [request.imageObjectDetectionModelDeploymentMetadata] + * Model deployment metadata specific to Image Object Detection. + * + * This object should have the same structure as [ImageObjectDetectionModelDeploymentMetadata]{@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} + * @param {Object} [request.imageClassificationModelDeploymentMetadata] + * Model deployment metadata specific to Image Classification. + * + * This object should have the same structure as [ImageClassificationModelDeploymentMetadata]{@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const automl = require('automl.v1'); + * + * const client = new automl.v1.AutoMlClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the promise pattern. + * client.deployModel({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the event emitter pattern. + * client.deployModel({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the await pattern. + * const [operation] = await client.deployModel({name: formattedName}); + * + * const [response] = await operation.promise(); + */ + deployModel(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.deployModel(request, options, callback); + } + + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * response field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name of the model to undeploy. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const automl = require('automl.v1'); + * + * const client = new automl.v1.AutoMlClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the promise pattern. + * client.undeployModel({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the event emitter pattern. + * client.undeployModel({name: formattedName}) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * + * // Handle the operation using the await pattern. + * const [operation] = await client.undeployModel({name: formattedName}); + * + * const [response] = await operation.promise(); + */ + undeployModel(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.undeployModel(request, options, callback); + } + + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * ModelExportOutputConfig. + * + * Returns an empty response in the + * response field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {Object} request.outputConfig + * Required. The desired output location and configuration. + * + * This object should have the same structure as [ModelExportOutputConfig]{@link google.cloud.automl.v1.ModelExportOutputConfig} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const automl = require('automl.v1'); + * + * const client = new automl.v1.AutoMlClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const outputConfig = {}; + * const request = { + * name: formattedName, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.exportModel(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const outputConfig = {}; + * const request = { + * name: formattedName, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.exportModel(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const outputConfig = {}; + * const request = { + * name: formattedName, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.exportModel(request); + * + * const [response] = await operation.promise(); + */ + exportModel(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.exportModel(request, options, callback); + } + /** * Gets a model evaluation. * @@ -1878,6 +2312,24 @@ class AutoMlClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified annotation_spec resource name string. + * + * @param {String} project + * @param {String} location + * @param {String} dataset + * @param {String} annotationSpec + * @returns {String} + */ + annotationSpecPath(project, location, dataset, annotationSpec) { + return this._pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + /** * Return a fully-qualified dataset resource name string. * @@ -1942,6 +2394,58 @@ class AutoMlClient { }); } + /** + * Parse the annotationSpecName from a annotation_spec resource. + * + * @param {String} annotationSpecName + * A fully-qualified path representing a annotation_spec resources. + * @returns {String} - A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName) { + return this._pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the annotationSpecName from a annotation_spec resource. + * + * @param {String} annotationSpecName + * A fully-qualified path representing a annotation_spec resources. + * @returns {String} - A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName) { + return this._pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the annotationSpecName from a annotation_spec resource. + * + * @param {String} annotationSpecName + * A fully-qualified path representing a annotation_spec resources. + * @returns {String} - A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName) { + return this._pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotationSpecName from a annotation_spec resource. + * + * @param {String} annotationSpecName + * A fully-qualified path representing a annotation_spec resources. + * @returns {String} - A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName) { + return this._pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + /** * Parse the datasetName from a dataset resource. * diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client_config.json b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json index 09e36c155d2..e4800167114 100644 --- a/packages/google-cloud-automl/src/v1/auto_ml_client_config.json +++ b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json @@ -55,6 +55,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "CreateModel": { "timeout_millis": 20000, "retry_codes_name": "non_idempotent", @@ -80,6 +85,21 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetModelEvaluation": { "timeout_millis": 5000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_payload.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_payload.js index 9b773fb6f84..d8a3759ff16 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_payload.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_payload.js @@ -23,6 +23,39 @@ * * This object should have the same structure as [TranslationAnnotation]{@link google.cloud.automl.v1.TranslationAnnotation} * + * @property {Object} classification + * Annotation details for content or image classification. + * + * This object should have the same structure as [ClassificationAnnotation]{@link google.cloud.automl.v1.ClassificationAnnotation} + * + * @property {Object} imageObjectDetection + * Annotation details for image object detection. + * + * This object should have the same structure as [ImageObjectDetectionAnnotation]{@link google.cloud.automl.v1.ImageObjectDetectionAnnotation} + * + * @property {Object} textExtraction + * Annotation details for text extraction. + * + * This object should have the same structure as [TextExtractionAnnotation]{@link google.cloud.automl.v1.TextExtractionAnnotation} + * + * @property {Object} textSentiment + * Annotation details for text sentiment. + * + * This object should have the same structure as [TextSentimentAnnotation]{@link google.cloud.automl.v1.TextSentimentAnnotation} + * + * @property {string} annotationSpecId + * Output only . The resource ID of the annotation spec that + * this annotation pertains to. The annotation spec comes from either an + * ancestor dataset, or the dataset that was used to train the model in use. + * + * @property {string} displayName + * Output only. The value of + * display_name + * when the model was trained. Because this field returns a value at model + * training time, for different models trained using the same dataset, the + * returned value could be different as model owner could update the + * `display_name` between any two model training. + * * @typedef AnnotationPayload * @memberof google.cloud.automl.v1 * @see [google.cloud.automl.v1.AnnotationPayload definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/annotation_payload.proto} diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_spec.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_spec.js new file mode 100644 index 00000000000..e84977c85b8 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_annotation_spec.js @@ -0,0 +1,43 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A definition of an annotation spec. + * + * @property {string} name + * Output only. Resource name of the annotation spec. + * Form: + * + * 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + * + * @property {string} displayName + * Required. + * The name of the annotation spec to show in the interface. The name can be + * up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + * (_), and ASCII digits 0-9. + * + * @property {number} exampleCount + * Output only. The number of examples in the parent dataset + * labeled by the annotation spec. + * + * @typedef AnnotationSpec + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.AnnotationSpec definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/annotation_spec.proto} + */ +const AnnotationSpec = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_classification.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_classification.js new file mode 100644 index 00000000000..103c14f0282 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_classification.js @@ -0,0 +1,218 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Contains annotation details specific to classification. + * + * @property {number} score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence that the annotation is positive. If a user + * approves an annotation as negative or positive, the score value remains + * unchanged. If a user creates an annotation, the score is 0 for negative or + * 1 for positive. + * + * @typedef ClassificationAnnotation + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ClassificationAnnotation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/classification.proto} + */ +const ClassificationAnnotation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model evaluation metrics for classification problems. + * + * @property {number} auPrc + * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + * for the overall evaluation. + * + * @property {number} auRoc + * Output only. The Area Under Receiver Operating Characteristic curve metric. + * Micro-averaged for the overall evaluation. + * + * @property {number} logLoss + * Output only. The Log Loss metric. + * + * @property {Object[]} confidenceMetricsEntry + * Output only. Metrics for each confidence_threshold in + * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + * position_threshold = INT32_MAX_VALUE. + * ROC and precision-recall curves, and other aggregated metrics are derived + * from them. The confidence metrics entries may also be supplied for + * additional values of position_threshold, but from these no aggregated + * metrics are computed. + * + * This object should have the same structure as [ConfidenceMetricsEntry]{@link google.cloud.automl.v1.ConfidenceMetricsEntry} + * + * @property {Object} confusionMatrix + * Output only. Confusion matrix of the evaluation. + * Only set for MULTICLASS classification problems where number + * of labels is no more than 10. + * Only set for model level evaluation, not for evaluation per label. + * + * This object should have the same structure as [ConfusionMatrix]{@link google.cloud.automl.v1.ConfusionMatrix} + * + * @property {string[]} annotationSpecId + * Output only. The annotation spec ids used for this evaluation. + * + * @typedef ClassificationEvaluationMetrics + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ClassificationEvaluationMetrics definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/classification.proto} + */ +const ClassificationEvaluationMetrics = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Metrics for a single confidence threshold. + * + * @property {number} confidenceThreshold + * Output only. Metrics are computed with an assumption that the model + * never returns predictions with score lower than this value. + * + * @property {number} positionThreshold + * Output only. Metrics are computed with an assumption that the model + * always returns at most this many predictions (ordered by their score, + * descendingly), but they all still need to meet the confidence_threshold. + * + * @property {number} recall + * Output only. Recall (True Positive Rate) for the given confidence + * threshold. + * + * @property {number} precision + * Output only. Precision for the given confidence threshold. + * + * @property {number} falsePositiveRate + * Output only. False Positive Rate for the given confidence threshold. + * + * @property {number} f1Score + * Output only. The harmonic mean of recall and precision. + * + * @property {number} recallAt1 + * Output only. The Recall (True Positive Rate) when only considering the + * label that has the highest prediction score and not below the confidence + * threshold for each example. + * + * @property {number} precisionAt1 + * Output only. The precision when only considering the label that has the + * highest prediction score and not below the confidence threshold for each + * example. + * + * @property {number} falsePositiveRateAt1 + * Output only. The False Positive Rate when only considering the label that + * has the highest prediction score and not below the confidence threshold + * for each example. + * + * @property {number} f1ScoreAt1 + * Output only. The harmonic mean of + * recall_at1 + * and + * precision_at1. + * + * @property {number} truePositiveCount + * Output only. The number of model created labels that match a ground truth + * label. + * + * @property {number} falsePositiveCount + * Output only. The number of model created labels that do not match a + * ground truth label. + * + * @property {number} falseNegativeCount + * Output only. The number of ground truth labels that are not matched + * by a model created label. + * + * @property {number} trueNegativeCount + * Output only. The number of labels that were not created by the model, + * but if they would, they would not match a ground truth label. + * + * @typedef ConfidenceMetricsEntry + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/classification.proto} + */ + ConfidenceMetricsEntry: { + // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Confusion matrix of the model running the classification. + * + * @property {string[]} annotationSpecId + * Output only. IDs of the annotation specs used in the confusion matrix. + * + * @property {string[]} displayName + * Output only. Display name of the annotation specs used in the confusion + * matrix, as they were at the moment of the evaluation. + * + * @property {Object[]} row + * Output only. Rows in the confusion matrix. The number of rows is equal to + * the size of `annotation_spec_id`. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. + * + * This object should have the same structure as [Row]{@link google.cloud.automl.v1.Row} + * + * @typedef ConfusionMatrix + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/classification.proto} + */ + ConfusionMatrix: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Output only. A row in the confusion matrix. + * + * @property {number[]} exampleCount + * Output only. Value of the specific cell in the confusion matrix. + * The number of values each row has (i.e. the length of the row) is equal + * to the length of the `annotation_spec_id` field or, if that one is not + * populated, length of the + * display_name + * field. + * + * @typedef Row + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/classification.proto} + */ + Row: { + // This is for documentation. Actual contents will be loaded by gRPC. + } + } +}; + +/** + * Type of the classification problem. + * + * @enum {number} + * @memberof google.cloud.automl.v1 + */ +const ClassificationType = { + + /** + * An un-set value of this enum. + */ + CLASSIFICATION_TYPE_UNSPECIFIED: 0, + + /** + * At most one label is allowed per example. + */ + MULTICLASS: 1, + + /** + * Multiple labels are allowed for one example. + */ + MULTILABEL: 2 +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_data_items.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_data_items.js index 61cabdb3436..b14920e08bc 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_data_items.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_data_items.js @@ -15,6 +15,26 @@ // Note: this file is purely for documentation. Any contents are not expected // to be loaded as the JS file. +/** + * A representation of an image. + * Only images up to 30MB in size are supported. + * + * @property {Buffer} imageBytes + * Image content represented as a stream of bytes. + * Note: As with all `bytes` fields, protobuffers use a pure binary + * representation, whereas JSON representations use base64. + * + * @property {string} thumbnailUri + * Output only. HTTP URI to the thumbnail image. + * + * @typedef Image + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.Image definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/data_items.proto} + */ +const Image = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * A representation of a text snippet. * @@ -23,9 +43,11 @@ * characters long. * * @property {string} mimeType - * Optional. The format of content. Currently the only two allowed - * values are "text/html" and "text/plain". If left blank, the format is - * automatically determined from the type of the uploaded content. + * Optional. The format of + * content. Currently the only + * two allowed values are "text/html" and "text/plain". If left blank, the + * format is automatically determined from the type of the uploaded + * content. * * @property {string} contentUri * Output only. HTTP URI where you can download the content. @@ -38,14 +60,224 @@ const TextSnippet = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Message that describes dimension of a document. + * + * @property {number} unit + * Unit of the dimension. + * + * The number should be among the values of [DocumentDimensionUnit]{@link google.cloud.automl.v1.DocumentDimensionUnit} + * + * @property {number} width + * Width value of the document, works together with the unit. + * + * @property {number} height + * Height value of the document, works together with the unit. + * + * @typedef DocumentDimensions + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.DocumentDimensions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/data_items.proto} + */ +const DocumentDimensions = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Unit of the document dimension. + * + * @enum {number} + * @memberof google.cloud.automl.v1 + */ + DocumentDimensionUnit: { + + /** + * Should not be used. + */ + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED: 0, + + /** + * Document dimension is measured in inches. + */ + INCH: 1, + + /** + * Document dimension is measured in centimeters. + */ + CENTIMETER: 2, + + /** + * Document dimension is measured in points. 72 points = 1 inch. + */ + POINT: 3 + } +}; + +/** + * A structured text document e.g. a PDF. + * + * @property {Object} inputConfig + * An input config specifying the content of the document. + * + * This object should have the same structure as [DocumentInputConfig]{@link google.cloud.automl.v1.DocumentInputConfig} + * + * @property {Object} documentText + * The plain text version of this document. + * + * This object should have the same structure as [TextSnippet]{@link google.cloud.automl.v1.TextSnippet} + * + * @property {Object[]} layout + * Describes the layout of the document. + * Sorted by page_number. + * + * This object should have the same structure as [Layout]{@link google.cloud.automl.v1.Layout} + * + * @property {Object} documentDimensions + * The dimensions of the page in the document. + * + * This object should have the same structure as [DocumentDimensions]{@link google.cloud.automl.v1.DocumentDimensions} + * + * @property {number} pageCount + * Number of pages in the document. + * + * @typedef Document + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.Document definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/data_items.proto} + */ +const Document = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Describes the layout information of a + * text_segment in the + * document. + * + * @property {Object} textSegment + * Text Segment that represents a segment in + * document_text. + * + * This object should have the same structure as [TextSegment]{@link google.cloud.automl.v1.TextSegment} + * + * @property {number} pageNumber + * Page number of the + * text_segment in + * the original document, starts from 1. + * + * @property {Object} boundingPoly + * The position of the + * text_segment in + * the page. Contains exactly 4 + * + * normalized_vertices + * and they are connected by edges in the order provided, which will + * represent a rectangle parallel to the frame. The + * NormalizedVertex-s are + * relative to the page. + * Coordinates are based on top-left as point (0,0). + * + * This object should have the same structure as [BoundingPoly]{@link google.cloud.automl.v1.BoundingPoly} + * + * @property {number} textSegmentType + * The type of the + * text_segment in + * document. + * + * The number should be among the values of [TextSegmentType]{@link google.cloud.automl.v1.TextSegmentType} + * + * @typedef Layout + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.Document.Layout definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/data_items.proto} + */ + Layout: { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * The type of TextSegment in the context of the original document. + * + * @enum {number} + * @memberof google.cloud.automl.v1 + */ + TextSegmentType: { + + /** + * Should not be used. + */ + TEXT_SEGMENT_TYPE_UNSPECIFIED: 0, + + /** + * The text segment is a token. e.g. word. + */ + TOKEN: 1, + + /** + * The text segment is a paragraph. + */ + PARAGRAPH: 2, + + /** + * The text segment is a form field. + */ + FORM_FIELD: 3, + + /** + * The text segment is the name part of a form field. It will be treated + * as child of another FORM_FIELD TextSegment if its span is subspan of + * another TextSegment with type FORM_FIELD. + */ + FORM_FIELD_NAME: 4, + + /** + * The text segment is the text content part of a form field. It will be + * treated as child of another FORM_FIELD TextSegment if its span is + * subspan of another TextSegment with type FORM_FIELD. + */ + FORM_FIELD_CONTENTS: 5, + + /** + * The text segment is a whole table, including headers, and all rows. + */ + TABLE: 6, + + /** + * The text segment is a table's headers. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + */ + TABLE_HEADER: 7, + + /** + * The text segment is a row in table. It will be treated as child of + * another TABLE TextSegment if its span is subspan of another TextSegment + * with type TABLE. + */ + TABLE_ROW: 8, + + /** + * The text segment is a cell in table. It will be treated as child of + * another TABLE_ROW TextSegment if its span is subspan of another + * TextSegment with type TABLE_ROW. + */ + TABLE_CELL: 9 + } + } +}; + /** * Example data used for training or prediction. * + * @property {Object} image + * Example image. + * + * This object should have the same structure as [Image]{@link google.cloud.automl.v1.Image} + * * @property {Object} textSnippet * Example text. * * This object should have the same structure as [TextSnippet]{@link google.cloud.automl.v1.TextSnippet} * + * @property {Object} document + * Example document. + * + * This object should have the same structure as [Document]{@link google.cloud.automl.v1.Document} + * * @typedef ExamplePayload * @memberof google.cloud.automl.v1 * @see [google.cloud.automl.v1.ExamplePayload definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/data_items.proto} diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_dataset.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_dataset.js index 6ab4c2fee52..c78cbe240ce 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_dataset.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_dataset.js @@ -24,6 +24,31 @@ * * This object should have the same structure as [TranslationDatasetMetadata]{@link google.cloud.automl.v1.TranslationDatasetMetadata} * + * @property {Object} imageClassificationDatasetMetadata + * Metadata for a dataset used for image classification. + * + * This object should have the same structure as [ImageClassificationDatasetMetadata]{@link google.cloud.automl.v1.ImageClassificationDatasetMetadata} + * + * @property {Object} textClassificationDatasetMetadata + * Metadata for a dataset used for text classification. + * + * This object should have the same structure as [TextClassificationDatasetMetadata]{@link google.cloud.automl.v1.TextClassificationDatasetMetadata} + * + * @property {Object} imageObjectDetectionDatasetMetadata + * Metadata for a dataset used for image object detection. + * + * This object should have the same structure as [ImageObjectDetectionDatasetMetadata]{@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} + * + * @property {Object} textExtractionDatasetMetadata + * Metadata for a dataset used for text extraction. + * + * This object should have the same structure as [TextExtractionDatasetMetadata]{@link google.cloud.automl.v1.TextExtractionDatasetMetadata} + * + * @property {Object} textSentimentDatasetMetadata + * Metadata for a dataset used for text sentiment. + * + * This object should have the same structure as [TextSentimentDatasetMetadata]{@link google.cloud.automl.v1.TextSentimentDatasetMetadata} + * * @property {string} name * Output only. The resource name of the dataset. * Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_detection.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_detection.js new file mode 100644 index 00000000000..8bbd465c8a1 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_detection.js @@ -0,0 +1,113 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Annotation details for image object detection. + * + * @property {Object} boundingBox + * Output only. The rectangle representing the object location. + * + * This object should have the same structure as [BoundingPoly]{@link google.cloud.automl.v1.BoundingPoly} + * + * @property {number} score + * Output only. The confidence that this annotation is positive for the parent + * example, value in [0, 1], higher means higher positivity confidence. + * + * @typedef ImageObjectDetectionAnnotation + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageObjectDetectionAnnotation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/detection.proto} + */ +const ImageObjectDetectionAnnotation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Bounding box matching model metrics for a single intersection-over-union + * threshold and multiple label match confidence thresholds. + * + * @property {number} iouThreshold + * Output only. The intersection-over-union threshold value used to compute + * this metrics entry. + * + * @property {number} meanAveragePrecision + * Output only. The mean average precision, most often close to au_prc. + * + * @property {Object[]} confidenceMetricsEntries + * Output only. Metrics for each label-match confidence_threshold from + * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + * derived from them. + * + * This object should have the same structure as [ConfidenceMetricsEntry]{@link google.cloud.automl.v1.ConfidenceMetricsEntry} + * + * @typedef BoundingBoxMetricsEntry + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BoundingBoxMetricsEntry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/detection.proto} + */ +const BoundingBoxMetricsEntry = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Metrics for a single confidence threshold. + * + * @property {number} confidenceThreshold + * Output only. The confidence threshold value used to compute the metrics. + * + * @property {number} recall + * Output only. Recall under the given confidence threshold. + * + * @property {number} precision + * Output only. Precision under the given confidence threshold. + * + * @property {number} f1Score + * Output only. The harmonic mean of recall and precision. + * + * @typedef ConfidenceMetricsEntry + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/detection.proto} + */ + ConfidenceMetricsEntry: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; + +/** + * Model evaluation metrics for image object detection problems. + * Evaluates prediction quality of labeled bounding boxes. + * + * @property {number} evaluatedBoundingBoxCount + * Output only. The total number of bounding boxes (i.e. summed over all + * images) the ground truth used to create this evaluation had. + * + * @property {Object[]} boundingBoxMetricsEntries + * Output only. The bounding boxes match metrics for each + * Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + * pair. + * + * This object should have the same structure as [BoundingBoxMetricsEntry]{@link google.cloud.automl.v1.BoundingBoxMetricsEntry} + * + * @property {number} boundingBoxMeanAveragePrecision + * Output only. The single metric for bounding boxes evaluation: + * the mean_average_precision averaged over all bounding_box_metrics_entries. + * + * @typedef ImageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/detection.proto} + */ +const ImageObjectDetectionEvaluationMetrics = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_geometry.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_geometry.js new file mode 100644 index 00000000000..588190e1e46 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_geometry.js @@ -0,0 +1,55 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A vertex represents a 2D point in the image. + * The normalized vertex coordinates are between 0 to 1 fractions relative to + * the original plane (image, video). E.g. if the plane (e.g. whole image) would + * have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would + * be at the position (1, 6) on that plane. + * + * @property {number} x + * Required. Horizontal coordinate. + * + * @property {number} y + * Required. Vertical coordinate. + * + * @typedef NormalizedVertex + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.NormalizedVertex definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/geometry.proto} + */ +const NormalizedVertex = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * A bounding polygon of a detected object on a plane. + * On output both vertices and normalized_vertices are provided. + * The polygon is formed by connecting vertices in the order they are listed. + * + * @property {Object[]} normalizedVertices + * Output only . The bounding polygon normalized vertices. + * + * This object should have the same structure as [NormalizedVertex]{@link google.cloud.automl.v1.NormalizedVertex} + * + * @typedef BoundingPoly + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BoundingPoly definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/geometry.proto} + */ +const BoundingPoly = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_image.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_image.js new file mode 100644 index 00000000000..aef7fb47851 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_image.js @@ -0,0 +1,227 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Dataset metadata that is specific to image classification. + * + * @property {number} classificationType + * Required. Type of the classification problem. + * + * The number should be among the values of [ClassificationType]{@link google.cloud.automl.v1.ClassificationType} + * + * @typedef ImageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageClassificationDatasetMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageClassificationDatasetMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Dataset metadata specific to image object detection. + * @typedef ImageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageObjectDetectionDatasetMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model metadata for image classification. + * + * @property {string} baseModelId + * Optional. The ID of the `base` model. If it is specified, the new model + * will be created based on the `base` model. Otherwise, the new model will be + * created from scratch. The `base` model must be in the same + * `project` and `location` as the new model to create, and have the same + * `model_type`. + * + * @property {number} trainBudgetMilliNodeHours + * The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud`(default), the train budget must be between 8,000 + * and 800,000 milli node hours, inclusive. The default value is 192, 000 + * which represents one day in wall time. For model type + * `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + * `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + * `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + * and 100,000 milli node hours, inclusive. The default value is 24, 000 which + * represents one day in wall time. + * + * @property {number} trainCostMilliNodeHours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * @property {string} stopReason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * @property {string} modelType + * Optional. Type of the model. The available values are: + * * `cloud` - Model to be used via prediction calls to AutoML API. + * This is the default value. + * * `mobile-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * AutoMl.ExportModel) + * and used on a mobile or edge device with TensorFlow + * afterwards. Expected to have low latency, but may have lower + * prediction quality than other models. + * * `mobile-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * AutoMl.ExportModel) + * and used on a mobile or edge device with TensorFlow + * afterwards. + * * `mobile-high-accuracy-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * AutoMl.ExportModel) + * and used on a mobile or edge device with TensorFlow + * afterwards. Expected to have a higher latency, but should + * also have a higher prediction quality than other models. + * * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * AutoMl.ExportModel) + * and used on a mobile device with Core ML afterwards. Expected + * to have low latency, but may have lower prediction quality + * than other models. + * * `mobile-core-ml-versatile-1` - A model that, in addition to providing + * prediction via AutoML API, can also be exported (see + * AutoMl.ExportModel) + * and used on a mobile device with Core ML afterwards. + * * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + * providing prediction via AutoML API, can also be exported + * (see + * AutoMl.ExportModel) + * and used on a mobile device with Core ML afterwards. Expected + * to have a higher latency, but should also have a higher + * prediction quality than other models. + * + * @property {number} nodeQps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * @property {number} nodeCount + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * + * @typedef ImageClassificationModelMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageClassificationModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageClassificationModelMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model metadata specific to image object detection. + * + * @property {string} modelType + * Optional. Type of the model. The available values are: + * * `cloud-high-accuracy-1` - (default) A model to be used via prediction + * calls to AutoML API. Expected to have a higher latency, but + * should also have a higher prediction quality than other + * models. + * * `cloud-low-latency-1` - A model to be used via prediction + * calls to AutoML API. Expected to have low latency, but may + * have lower prediction quality than other models. + * + * @property {number} nodeCount + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the qps_per_node field. + * + * @property {number} nodeQps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * @property {string} stopReason + * Output only. The reason that this create model operation stopped, + * e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + * + * @property {number} trainBudgetMilliNodeHours + * The train budget of creating this model, expressed in milli node + * hours i.e. 1,000 value in this field means 1 node hour. The actual + * `train_cost` will be equal or less than this value. If further model + * training ceases to provide any improvements, it will stop without using + * full budget and the stop_reason will be `MODEL_CONVERGED`. + * Note, node_hour = actual_hour * number_of_nodes_invovled. + * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + * the train budget must be between 20,000 and 900,000 milli node hours, + * inclusive. The default value is 216, 000 which represents one day in + * wall time. + * For model type `mobile-low-latency-1`, `mobile-versatile-1`, + * `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + * `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + * budget must be between 1,000 and 100,000 milli node hours, inclusive. + * The default value is 24, 000 which represents one day in wall time. + * + * @property {number} trainCostMilliNodeHours + * Output only. The actual train cost of creating this model, expressed in + * milli node hours, i.e. 1,000 value in this field means 1 node hour. + * Guaranteed to not exceed the train budget. + * + * @typedef ImageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageObjectDetectionModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageObjectDetectionModelMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model deployment metadata specific to Image Classification. + * + * @property {number} nodeCount + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * + * node_qps. + * Must be between 1 and 100, inclusive on both ends. + * + * @typedef ImageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageClassificationModelDeploymentMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model deployment metadata specific to Image Object Detection. + * + * @property {number} nodeCount + * Input only. The number of nodes to deploy the model on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the model's + * + * qps_per_node. + * Must be between 1 and 100, inclusive on both ends. + * + * @typedef ImageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/image.proto} + */ +const ImageObjectDetectionModelDeploymentMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_io.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_io.js index 0df3acad00d..8983ce06f98 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_io.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_io.js @@ -16,7 +16,8 @@ // to be loaded as the JS file. /** - * Input configuration for ImportData Action. + * Input configuration for + * AutoMl.ImportData action. * * The format of input depends on dataset_metadata the Dataset into which * the import is happening has. As input source the @@ -24,12 +25,433 @@ * is expected, unless specified otherwise. Additionally any input .CSV file * by itself must be 100MB or smaller, unless specified otherwise. * If an "example" file (that is, image, video etc.) with identical content - * (even if it had different GCS_FILE_PATH) is mentioned multiple times, then + * (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then * its label, bounding boxes etc. are appended. The same file should be always - * provided with the same ML_USE and GCS_FILE_PATH, if it is not, then + * provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then * these values are nondeterministically selected from the given ones. * - * Errors: + * The formats are represented in EBNF with commas being literal and with + * non-terminal symbols defined near the end of this comment. The formats are: + * + *

AutoML Vision

+ * + * + *
Classification
+ * + * See [Preparing your training + * data](https://cloud.google.com/vision/automl/docs/prepare) for more + * information. + * + * CSV file(s) with each line in format: + * + * ML_USE,GCS_FILE_PATH,LABEL,LABEL,... + * + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * + * * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to + * 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, + * .TIFF, .ICO. + * + * * `LABEL` - A label that identifies the object in the image. + * + * For the `MULTICLASS` classification type, at most one `LABEL` is allowed + * per image. If an image has not yet been labeled, then it should be + * mentioned just once with no `LABEL`. + * + * Some sample rows: + * + * TRAIN,gs://folder/image1.jpg,daisy + * TEST,gs://folder/image2.jpg,dandelion,tulip,rose + * UNASSIGNED,gs://folder/image3.jpg,daisy + * UNASSIGNED,gs://folder/image4.jpg + * + * + *
Object Detection
+ * See [Preparing your training + * data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) + * for more information. + * + * A CSV file(s) with each line in format: + * + * ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) + * + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * + * * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to + * 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image + * is assumed to be exhaustively labeled. + * + * * `LABEL` - A label that identifies the object in the image specified by the + * `BOUNDING_BOX`. + * + * * `BOUNDING BOX` - The vertices of an object in the example image. + * The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than + * 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` + * per line). If an image has no looked for objects then it should be + * mentioned just once with no LABEL and the ",,,,,,," in place of the + * `BOUNDING_BOX`. + * + * **Four sample rows:** + * + * TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, + * TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, + * UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 + * TEST,gs://folder/im3.png,,,,,,,,, + *
+ *
+ * + * + *

AutoML Natural Language

+ * + * + *
Entity Extraction
+ * + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/entity-analysis/docs/prepare) for more + * information. + * + * One or more CSV file(s) with each line in the following format: + * + * ML_USE,GCS_FILE_PATH + * + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing.. + * + * * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in + * Google Cloud Storage that contains in-line text in-line as documents + * for model training. + * + * After the training data set has been determined from the `TRAIN` and + * `UNASSIGNED` CSV files, the training data is divided into train and + * validation data sets. 70% for training and 30% for validation. + * + * For example: + * + * TRAIN,gs://folder/file1.jsonl + * VALIDATE,gs://folder/file2.jsonl + * TEST,gs://folder/file3.jsonl + * + * **In-line JSONL files** + * + * In-line .JSONL files contain, per line, a JSON document that wraps a + * `text_snippet` field followed by + * one or more `annotations` + * fields, which have `display_name` and `text_extraction` fields to describe + * the entity from the text snippet. Multiple JSON documents can be separated + * using line breaks (\n). + * + * The supplied text must be annotated exhaustively. For example, if you + * include the text "horse", but do not label it as "animal", + * then "horse" is assumed to not be an "animal". + * + * Any given text snippet content must have 30,000 characters or + * less, and also be UTF-8 NFC encoded. ASCII is accepted as it is + * UTF-8 NFC encoded. + * + * For example: + * + * { + * "text_snippet": { + * "content": "dog car cat" + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 2} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 6} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 10} + * } + * } + * ] + * }\n + * { + * "text_snippet": { + * "content": "This dog is good." + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 5, "end_offset": 7} + * } + * } + * ] + * } + * + * **JSONL files that reference documents** + * + * .JSONL files contain, per line, a JSON document that wraps a + * `input_config` that contains the path to a source PDF document. + * Multiple JSON documents can be separated using line breaks (\n). + * + * For example: + * + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] + * } + * } + * } + * }\n + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] + * } + * } + * } + * } + * + * **In-line JSONL files with PDF layout information** + * + * **Note:** You can only annotate PDF files using the UI. The format described + * below applies to annotated PDF files exported using the UI or `exportData`. + * + * In-line .JSONL files for PDF documents contain, per line, a JSON document + * that wraps a `document` field that provides the textual content of the PDF + * document and the layout information. + * + * For example: + * + * { + * "document": { + * "document_text": { + * "content": "dog car cat" + * } + * "layout": [ + * { + * "text_segment": { + * "start_offset": 0, + * "end_offset": 11, + * }, + * "page_number": 1, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ], + * }, + * "text_segment_type": TOKEN, + * } + * ], + * "document_dimensions": { + * "width": 8.27, + * "height": 11.69, + * "unit": INCH, + * } + * "page_count": 3, + * }, + * "annotations": [ + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 0, "end_offset": 3} + * } + * }, + * { + * "display_name": "vehicle", + * "text_extraction": { + * "text_segment": {"start_offset": 4, "end_offset": 7} + * } + * }, + * { + * "display_name": "animal", + * "text_extraction": { + * "text_segment": {"start_offset": 8, "end_offset": 11} + * } + * }, + * ], + * + * + * + * + *
Classification
+ * + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * + * One or more CSV file(s) with each line in the following format: + * + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... + * + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 10MB or + * less in size. For zip files, the size of each file inside the zip must be + * 10MB or less in size. + * + * For the `MULTICLASS` classification type, at most one `LABEL` is allowed. + * The `ML_USE` and `LABEL` columns are optional. + * Supported file extensions: .TXT, .PDF, .ZIP + * + * A maximum of 100 unique labels are allowed per CSV row. + * + * Sample rows: + * + * TRAIN,"They have bad food and very rude",RudeService,BadFood + * gs://folder/content.txt,SlowService + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,BadFood + * + * + * + *
Sentiment Analysis
+ * + * See [Preparing your training + * data](https://cloud.google.com/natural-language/automl/docs/prepare) for more + * information. + * + * CSV file(s) with each line in format: + * + * ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT + * + * * `ML_USE` - Identifies the data set that the current row (file) applies + * to. + * This value can be one of the following: + * * `TRAIN` - Rows in this file are used to train the model. + * * `TEST` - Rows in this file are used to test the model during training. + * * `UNASSIGNED` - Rows in this file are not categorized. They are + * Automatically divided into train and test data. 80% for training and + * 20% for testing. + * + * * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If + * the column content is a valid Google Cloud Storage file path, that is, + * prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if + * the content is enclosed in double quotes (""), it is treated as a + * `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a + * file with supported extension and UTF-8 encoding, for example, + * "gs://folder/content.txt" AutoML imports the file content + * as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content + * excluding quotes. In both cases, size of the content must be 128kB or + * less in size. For zip files, the size of each file inside the zip must be + * 128kB or less in size. + * + * The `ML_USE` and `SENTIMENT` columns are optional. + * Supported file extensions: .TXT, .PDF, .ZIP + * + * * `SENTIMENT` - An integer between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max + * (inclusive). Describes the ordinal of the sentiment - higher + * value means a more positive sentiment. All the values are + * completely relative, i.e. neither 0 needs to mean a negative or + * neutral sentiment nor sentiment_max needs to mean a positive one - + * it is just required that 0 is the least positive sentiment + * in the data, and sentiment_max is the most positive one. + * The SENTIMENT shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * All SENTIMENT values between 0 and sentiment_max must be + * represented in the imported data. On prediction the same 0 to + * sentiment_max range will be used. The difference between + * neighboring sentiment values needs not to be uniform, e.g. 1 and + * 2 may be similar whereas the difference between 2 and 3 may be + * large. + * + * Sample rows: + * + * TRAIN,"@freewrytin this is way too good for your product",2 + * gs://folder/content.txt,3 + * TEST,gs://folder/document.pdf + * VALIDATE,gs://folder/text_files.zip,2 + *
+ *
+ * + * + * **Input field definitions:** + * + * `ML_USE` + * : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") + * Describes how the given example (file) should be used for model + * training. "UNASSIGNED" can be used when user has no preference. + * + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/image1.png". + * + * `LABEL` + * : A display name of an object on an image, video etc., e.g. "dog". + * Must be up to 32 characters long and can consist only of ASCII + * Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. + * For each label an AnnotationSpec is created which display_name + * becomes the label; AnnotationSpecs are given back in predictions. + * + * `BOUNDING_BOX` + * : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) + * A rectangle parallel to the frame of the example (image, + * video). If 4 vertices are given they are connected by edges + * in the order provided, if 2 are given they are recognized + * as diagonally opposite vertices of the rectangle. + * + * `VERTEX` + * : (`COORDINATE,COORDINATE`) + * First coordinate is horizontal (x), the second is vertical (y). + * + * `COORDINATE` + * : A float in 0 to 1 range, relative to total length of + * image or video in given dimension. For fractions the + * leading non-decimal 0 can be omitted (i.e. 0.3 = .3). + * Point 0,0 is in top left. + * + * `TEXT_SNIPPET` + * : The content of a text snippet, UTF-8 encoded, enclosed within + * double quotes (""). + * + * `DOCUMENT` + * : A field that provides the textual content with document and the layout + * information. + * + * + * **Errors:** + * * If any of the provided CSV files can't be parsed or if more than certain * percent of CSV rows cannot be processed then the operation fails and * nothing is imported. Regardless of overall success or failure the per-row @@ -38,8 +460,9 @@ * * @property {Object} gcsSource * The Google Cloud Storage location for the input content. - * In ImportData, the gcs_source points to a csv with structure described in - * the comment. + * For AutoMl.ImportData, + * `gcs_source` points to a CSV file with a structure described in + * InputConfig. * * This object should have the same structure as [GcsSource]{@link google.cloud.automl.v1.GcsSource} * @@ -57,7 +480,232 @@ const InputConfig = { }; /** - * * For Translation: + * Input configuration for BatchPredict Action. + * + * The format of input depends on the ML problem of the model used for + * prediction. As input source the + * gcs_source + * is expected, unless specified otherwise. + * + * The formats are represented in EBNF with commas being literal and with + * non-terminal symbols defined near the end of this comment. The formats + * are: + * + *

AutoML Natural Language

+ *
Classification
+ * + * One or more CSV files where each line is a single column: + * + * GCS_FILE_PATH + * + * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. + * Supported file extensions: .TXT, .PDF + * Text files can be no larger than 10MB in size. + * + * Sample rows: + * + * gs://folder/text1.txt + * gs://folder/text2.pdf + * + *
Sentiment Analysis
+ * One or more CSV files where each line is a single column: + * + * GCS_FILE_PATH + * + * `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. + * Supported file extensions: .TXT, .PDF + * Text files can be no larger than 128kB in size. + * + * Sample rows: + * + * gs://folder/text1.txt + * gs://folder/text2.pdf + * + *
Entity Extraction
+ * + * One or more JSONL (JSON Lines) files that either provide inline text or + * documents. You can only use one format, either inline text or documents, + * for a single call to [AutoMl.BatchPredict]. + * + * Each JSONL file contains a per line a proto that + * wraps a temporary user-assigned TextSnippet ID (string up to 2000 + * characters long) called "id", a TextSnippet proto (in + * JSON representation) and zero or more TextFeature protos. Any given + * text snippet content must have 30,000 characters or less, and also + * be UTF-8 NFC encoded (ASCII already is). The IDs provided should be + * unique. + * + * Each document JSONL file contains, per line, a proto that wraps a + * Document proto with `input_config` set. Only PDF documents are + * currently supported, and each PDF document cannot exceed 2MB in size. + * + * Each JSONL file must not exceed 100MB in size, and no more than 20 + * JSONL files may be passed. + * + * Sample inline JSONL file (Shown with artificial line + * breaks. Actual line breaks are denoted by "\n".): + * + * { + * "id": "my_first_id", + * "text_snippet": { "content": "dog car cat"}, + * "text_features": [ + * { + * "text_segment": {"start_offset": 4, "end_offset": 6}, + * "structural_type": PARAGRAPH, + * "bounding_poly": { + * "normalized_vertices": [ + * {"x": 0.1, "y": 0.1}, + * {"x": 0.1, "y": 0.3}, + * {"x": 0.3, "y": 0.3}, + * {"x": 0.3, "y": 0.1}, + * ] + * }, + * } + * ], + * }\n + * { + * "id": "2", + * "text_snippet": { + * "content": "Extended sample content", + * "mime_type": "text/plain" + * } + * } + * + * Sample document JSONL file (Shown with artificial line + * breaks. Actual line breaks are denoted by "\n".): + * + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] + * } + * } + * } + * }\n + * { + * "document": { + * "input_config": { + * "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] + * } + * } + * } + * } + *
+ *
+ * + * **Input field definitions:** + * + * `GCS_FILE_PATH` + * : The path to a file on Google Cloud Storage. For example, + * "gs://folder/video.avi". + * + * **Errors:** + * + * If any of the provided CSV files can't be parsed or if more than certain + * percent of CSV rows cannot be processed then the operation fails and + * prediction does not happen. Regardless of overall success or failure the + * per-row failures, up to a certain count cap, will be listed in + * Operation.metadata.partial_failures. + * + * @property {Object} gcsSource + * Required. The Google Cloud Storage location for the input content. + * + * This object should have the same structure as [GcsSource]{@link google.cloud.automl.v1.GcsSource} + * + * @typedef BatchPredictInputConfig + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BatchPredictInputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/io.proto} + */ +const BatchPredictInputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Input configuration of a Document. + * + * @property {Object} gcsSource + * The Google Cloud Storage location of the document file. Only a single path + * should be given. + * + * Max supported size: 512MB. + * + * Supported extensions: .PDF. + * + * This object should have the same structure as [GcsSource]{@link google.cloud.automl.v1.GcsSource} + * + * @typedef DocumentInputConfig + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.DocumentInputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/io.proto} + */ +const DocumentInputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for ExportData. + * + * As destination the + * gcs_destination + * must be set unless specified otherwise for a domain. If gcs_destination is + * set then in the given directory a new directory is created. Its name + * will be "export_data--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. + * Only ground truth annotations are exported (not approved annotations are + * not exported). + * + * The outputs correspond to how the data was imported, and may be used as + * input to import data. The output formats are represented as EBNF with literal + * commas and same non-terminal symbols definitions are these in import data's + * InputConfig: + * + * * For Image Classification: + * CSV file(s) `image_classification_1.csv`, + * `image_classification_2.csv`,...,`image_classification_N.csv`with + * each line in format: + * ML_USE,GCS_FILE_PATH,LABEL,LABEL,... + * where GCS_FILE_PATHs point at the original, source locations of the + * imported images. + * For MULTICLASS classification type, there can be at most one LABEL + * per example. + * + * * For Image Object Detection: + * CSV file(s) `image_object_detection_1.csv`, + * `image_object_detection_2.csv`,...,`image_object_detection_N.csv` + * with each line in format: + * ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) + * where GCS_FILE_PATHs point at the original, source locations of the + * imported images. + * + * * For Text Classification: + * In the created directory CSV file(s) `text_classification_1.csv`, + * `text_classification_2.csv`, ...,`text_classification_N.csv` will be + * created where N depends on the total number of examples exported. + * Each line in the CSV is of the format: + * ML_USE,GCS_FILE_PATH,LABEL,LABEL,... + * where GCS_FILE_PATHs point at the exported .txt files containing + * the text content of the imported example. For MULTICLASS + * classification type, there will be at most one LABEL per example. + * + * * For Text Sentiment: + * In the created directory CSV file(s) `text_sentiment_1.csv`, + * `text_sentiment_2.csv`, ...,`text_sentiment_N.csv` will be + * created where N depends on the total number of examples exported. + * Each line in the CSV is of the format: + * ML_USE,GCS_FILE_PATH,SENTIMENT + * where GCS_FILE_PATHs point at the exported .txt files containing + * the text content of the imported example. + * + * * For Text Extraction: + * CSV file `text_extraction.csv`, with each line in format: + * ML_USE,GCS_FILE_PATH + * GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which + * contains, per line, a proto that wraps a TextSnippet proto (in json + * representation) followed by AnnotationPayload protos (called + * annotations). If initially documents had been imported, the JSONL + * will point at the original, source locations of the imported + * documents. + * + * * For Translation: * CSV file `translation.csv`, with each line in format: * ML_USE,GCS_FILE_PATH * GCS_FILE_PATH leads to a .TSV file which describes examples that have @@ -65,18 +713,10 @@ const InputConfig = { * TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target * language) * - * `export_data__` - * where will be made - * BigQuery-dataset-name compatible (e.g. most special characters will - * become underscores), and timestamp will be in - * YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that - * dataset a new table called `primary_table` will be created, and - * filled with precisely the same data as this obtained on import. - * * @property {Object} gcsDestination - * The Google Cloud Storage location where the output is to be written to. - * For Image Object Detection, Text Extraction, Video Classification and - * Tables, in the given directory a new directory will be created with name: + * Required. The Google Cloud Storage location where the output is to be + * written to. For Image Object Detection, Text Extraction in the given + * directory a new directory will be created with name: * export_data-- where * timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export * output will be written into that directory. @@ -91,12 +731,178 @@ const OutputConfig = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Output configuration for BatchPredict Action. + * + * As destination the + * + * gcs_destination + * must be set unless specified otherwise for a domain. If gcs_destination is + * set then in the given directory a new directory is created. Its name + * will be + * "prediction--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents + * of it depends on the ML problem the predictions are made for. + * + * * For Text Classification: + * In the created directory files `text_classification_1.jsonl`, + * `text_classification_2.jsonl`,...,`text_classification_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text (or pdf) file in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have classification detail populated. A single text (or pdf) file + * will be listed only once with all its annotations, and its + * annotations will never be split across files. + * + * If prediction for any text (or pdf) file failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input text (or pdf) file followed by exactly one + * + * [`google.rpc.Status`](https: + * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * + * * For Text Sentiment: + * In the created directory files `text_sentiment_1.jsonl`, + * `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * + * Each .JSONL file will contain, per line, a JSON representation of a + * proto that wraps input text (or pdf) file in + * the text snippet (or document) proto and a list of + * zero or more AnnotationPayload protos (called annotations), which + * have text_sentiment detail populated. A single text (or pdf) file + * will be listed only once with all its annotations, and its + * annotations will never be split across files. + * + * If prediction for any text (or pdf) file failed (partially or + * completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps input text (or pdf) file followed by exactly one + * + * [`google.rpc.Status`](https: + * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * + * * For Text Extraction: + * In the created directory files `text_extraction_1.jsonl`, + * `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` + * will be created, where N may be 1, and depends on the + * total number of inputs and annotations found. + * The contents of these .JSONL file(s) depend on whether the input + * used inline text, or documents. + * If input was inline, then each .JSONL file will contain, per line, + * a JSON representation of a proto that wraps given in request text + * snippet's "id" (if specified), followed by input text snippet, + * and a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated. A single text snippet will be + * listed only once with all its annotations, and its annotations will + * never be split across files. + * If input used documents, then each .JSONL file will contain, per + * line, a JSON representation of a proto that wraps given in request + * document proto, followed by its OCR-ed representation in the form + * of a text snippet, finally followed by a list of zero or more + * AnnotationPayload protos (called annotations), which have + * text_extraction detail populated and refer, via their indices, to + * the OCR-ed text snippet. A single document (and its text snippet) + * will be listed only once with all its annotations, and its + * annotations will never be split across files. + * If prediction for any text snippet failed (partially or completely), + * then additional `errors_1.jsonl`, `errors_2.jsonl`,..., + * `errors_N.jsonl` files will be created (N depends on total number of + * failed predictions). These files will have a JSON representation of a + * proto that wraps either the "id" : "" (in case of inline) + * or the document proto (in case of document) but here followed by + * exactly one [`google.rpc.Status`](https: + * //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) + * containing only `code` and `message`. + * + * @property {Object} gcsDestination + * Required. The Google Cloud Storage location of the directory where the + * output is to be written to. + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.automl.v1.GcsDestination} + * + * @typedef BatchPredictOutputConfig + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BatchPredictOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/io.proto} + */ +const BatchPredictOutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Output configuration for ModelExport Action. + * + * @property {Object} gcsDestination + * Required. The Google Cloud Storage location where the model is to be + * written to. This location may only be set for the following model + * formats: + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + * + * Under the directory given as the destination a new one with name + * "model-export--", + * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + * will be created. Inside the model and any of its supporting files + * will be written. + * + * This object should have the same structure as [GcsDestination]{@link google.cloud.automl.v1.GcsDestination} + * + * @property {string} modelFormat + * The format in which the model must be exported. The available, and default, + * formats depend on the problem and model type (if given problem and type + * combination doesn't have a format listed, it means its models are not + * exportable): + * + * * For Image Classification mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js". + * + * * For Image Classification mobile-core-ml-low-latency-1, + * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + * "core_ml" (default). + * + * * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + * mobile-high-accuracy-1: + * "tflite", "tf_saved_model", "tf_js". + * Formats description: + * + * * tflite - Used for Android mobile devices. + * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + * devices. + * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript.x` + * * core_ml - Used for iOS mobile devices. + * + * @property {Object.} params + * Additional model-type and format specific parameters describing the + * requirements for the to be exported model files, any string must be up to + * 25000 characters long. + * + * @typedef ModelExportOutputConfig + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ModelExportOutputConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/io.proto} + */ +const ModelExportOutputConfig = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * The Google Cloud Storage location for the input content. * * @property {string[]} inputUris - * Required. Google Cloud Storage URIs to input files, up to 2000 characters - * long. Accepted forms: + * Required. Google Cloud Storage URIs to input files, up to 2000 + * characters long. Accepted forms: * * Full object path, e.g. gs://bucket/directory/object.csv * * @typedef GcsSource diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model.js index da453063695..291dbae408d 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model.js @@ -23,6 +23,31 @@ * * This object should have the same structure as [TranslationModelMetadata]{@link google.cloud.automl.v1.TranslationModelMetadata} * + * @property {Object} imageClassificationModelMetadata + * Metadata for image classification models. + * + * This object should have the same structure as [ImageClassificationModelMetadata]{@link google.cloud.automl.v1.ImageClassificationModelMetadata} + * + * @property {Object} textClassificationModelMetadata + * Metadata for text classification models. + * + * This object should have the same structure as [TextClassificationModelMetadata]{@link google.cloud.automl.v1.TextClassificationModelMetadata} + * + * @property {Object} imageObjectDetectionModelMetadata + * Metadata for image object detection models. + * + * This object should have the same structure as [ImageObjectDetectionModelMetadata]{@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata} + * + * @property {Object} textExtractionModelMetadata + * Metadata for text extraction models. + * + * This object should have the same structure as [TextExtractionModelMetadata]{@link google.cloud.automl.v1.TextExtractionModelMetadata} + * + * @property {Object} textSentimentModelMetadata + * Metadata for text sentiment models. + * + * This object should have the same structure as [TextSentimentModelMetadata]{@link google.cloud.automl.v1.TextSentimentModelMetadata} + * * @property {string} name * Output only. Resource name of the model. * Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` @@ -53,6 +78,10 @@ * * The number should be among the values of [DeploymentState]{@link google.cloud.automl.v1.DeploymentState} * + * @property {string} etag + * Used to perform a consistent read-modify-write updates. If not set, a blind + * "overwrite" update happens. + * * @property {Object.} labels * Optional. The labels with user-defined metadata to organize your model. * diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model_evaluation.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model_evaluation.js index a89f596bc39..72f8d349489 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model_evaluation.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_model_evaluation.js @@ -18,11 +18,31 @@ /** * Evaluation results of a model. * + * @property {Object} classificationEvaluationMetrics + * Model evaluation metrics for image, text classification. + * + * This object should have the same structure as [ClassificationEvaluationMetrics]{@link google.cloud.automl.v1.ClassificationEvaluationMetrics} + * * @property {Object} translationEvaluationMetrics * Model evaluation metrics for translation. * * This object should have the same structure as [TranslationEvaluationMetrics]{@link google.cloud.automl.v1.TranslationEvaluationMetrics} * + * @property {Object} imageObjectDetectionEvaluationMetrics + * Model evaluation metrics for image object detection. + * + * This object should have the same structure as [ImageObjectDetectionEvaluationMetrics]{@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} + * + * @property {Object} textSentimentEvaluationMetrics + * Evaluation metrics for text sentiment models. + * + * This object should have the same structure as [TextSentimentEvaluationMetrics]{@link google.cloud.automl.v1.TextSentimentEvaluationMetrics} + * + * @property {Object} textExtractionEvaluationMetrics + * Evaluation metrics for text extraction models. + * + * This object should have the same structure as [TextExtractionEvaluationMetrics]{@link google.cloud.automl.v1.TextExtractionEvaluationMetrics} + * * @property {string} name * Output only. Resource name of the model evaluation. * Format: @@ -30,8 +50,16 @@ * `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` * * @property {string} annotationSpecId - * Output only. The ID of the annotation spec that the model evaluation applies to. The - * The ID is empty for the overall model evaluation. + * Output only. The ID of the annotation spec that the model evaluation + * applies to. The The ID is empty for the overall model evaluation. + * + * @property {string} displayName + * Output only. The value of + * display_name + * at the moment when the model was trained. Because this field returns a + * value at model training time, for different models trained from the same + * dataset, the values may differ, since display names could had been changed + * between the two model's trainings. * * @property {Object} createTime * Output only. Timestamp when this model evaluation was created. diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_prediction_service.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_prediction_service.js index a919c8805d3..91f2bcacef8 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_prediction_service.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_prediction_service.js @@ -32,6 +32,20 @@ * Additional domain-specific parameters, any string must be up to 25000 * characters long. * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * @typedef PredictRequest * @memberof google.cloud.automl.v1 * @see [google.cloud.automl.v1.PredictRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/prediction_service.proto} @@ -50,13 +64,116 @@ const PredictRequest = { * * This object should have the same structure as [AnnotationPayload]{@link google.cloud.automl.v1.AnnotationPayload} * + * @property {Object} preprocessedInput + * The preprocessed example that AutoML actually makes prediction on. + * Empty if AutoML does not preprocess the input example. + * * For Text Extraction: + * If the input is a .pdf file, the OCR'ed text will be provided in + * document_text. + * + * * For Text Classification: + * If the input is a .pdf file, the OCR'ed trucated text will be provided in + * document_text. + * + * * For Text Sentiment: + * If the input is a .pdf file, the OCR'ed trucated text will be provided in + * document_text. + * + * This object should have the same structure as [ExamplePayload]{@link google.cloud.automl.v1.ExamplePayload} + * * @property {Object.} metadata * Additional domain-specific prediction response metadata. * + * * For Image Object Detection: + * `max_bounding_box_count` - (int64) At most that many bounding boxes per + * image could have been returned. + * + * * For Text Sentiment: + * `sentiment_score` - (float, deprecated) A value between -1 and 1, + * -1 maps to least positive sentiment, while 1 maps to the most positive + * one and the higher the score, the more positive the sentiment in the + * document is. Yet these values are relative to the training data, so + * e.g. if all data was positive then -1 will be also positive (though + * the least). + * The sentiment_score shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * * @typedef PredictResponse * @memberof google.cloud.automl.v1 * @see [google.cloud.automl.v1.PredictResponse definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/prediction_service.proto} */ const PredictResponse = { // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for + * PredictionService.BatchPredict. + * + * @property {string} name + * Name of the model requested to serve the batch prediction. + * + * @property {Object} inputConfig + * Required. The input configuration for batch prediction. + * + * This object should have the same structure as [BatchPredictInputConfig]{@link google.cloud.automl.v1.BatchPredictInputConfig} + * + * @property {Object} outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * + * This object should have the same structure as [BatchPredictOutputConfig]{@link google.cloud.automl.v1.BatchPredictOutputConfig} + * + * @property {Object.} params + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * * For Text Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * + * @typedef BatchPredictRequest + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BatchPredictRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/prediction_service.proto} + */ +const BatchPredictRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Result of the Batch Predict. This message is returned in + * response of the operation returned + * by the + * PredictionService.BatchPredict. + * + * @property {Object.} metadata + * Additional domain-specific prediction response metadata. + * + * * For Image Object Detection: + * `max_bounding_box_count` - (int64) At most that many bounding boxes per + * image could have been returned. + * + * @typedef BatchPredictResult + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.BatchPredictResult definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/prediction_service.proto} + */ +const BatchPredictResult = { + // This is for documentation. Actual contents will be loaded by gRPC. }; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_service.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_service.js index 04ca4f380c1..d33f0814abd 100644 --- a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_service.js +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_service.js @@ -61,8 +61,8 @@ const GetDatasetRequest = { * An expression for filtering the results of the request. * * * `dataset_metadata` - for existence of the case (e.g. - * image_classification_dataset_metadata:*). - * Some examples of using the filter are: + * image_classification_dataset_metadata:*). Some examples of + * using the filter are: * * * `translation_dataset_metadata:*` --> The dataset has * translation_dataset_metadata. @@ -188,6 +188,21 @@ const ExportDataRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Request message for + * AutoMl.GetAnnotationSpec. + * + * @property {string} name + * The resource name of the annotation spec to retrieve. + * + * @typedef GetAnnotationSpecRequest + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.GetAnnotationSpecRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/service.proto} + */ +const GetAnnotationSpecRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Request message for * AutoMl.CreateModel. @@ -234,7 +249,7 @@ const GetModelRequest = { * An expression for filtering the results of the request. * * * `model_metadata` - for existence of the case (e.g. - * video_classification_model_metadata:*). + * image_classification_model_metadata:*). * * `dataset_id` - for = or !=. Some examples of using the filter are: * * * `image_classification_model_metadata:*` --> The model has @@ -319,6 +334,67 @@ const UpdateModelRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Request message for + * AutoMl.DeployModel. + * + * @property {Object} imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * + * This object should have the same structure as [ImageObjectDetectionModelDeploymentMetadata]{@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} + * + * @property {Object} imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * + * This object should have the same structure as [ImageClassificationModelDeploymentMetadata]{@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} + * + * @property {string} name + * Resource name of the model to deploy. + * + * @typedef DeployModelRequest + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.DeployModelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/service.proto} + */ +const DeployModelRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for + * AutoMl.UndeployModel. + * + * @property {string} name + * Resource name of the model to undeploy. + * + * @typedef UndeployModelRequest + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.UndeployModelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/service.proto} + */ +const UndeployModelRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Request message for + * AutoMl.ExportModel. Models need + * to be enabled for exporting, otherwise an error code will be returned. + * + * @property {string} name + * Required. The resource name of the model to export. + * + * @property {Object} outputConfig + * Required. The desired output location and configuration. + * + * This object should have the same structure as [ModelExportOutputConfig]{@link google.cloud.automl.v1.ModelExportOutputConfig} + * + * @typedef ExportModelRequest + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.ExportModelRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/service.proto} + */ +const ExportModelRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Request message for * AutoMl.GetModelEvaluation. diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text.js new file mode 100644 index 00000000000..3722bb1f9f4 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text.js @@ -0,0 +1,96 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Dataset metadata for classification. + * + * @property {number} classificationType + * Required. Type of the classification problem. + * + * The number should be among the values of [ClassificationType]{@link google.cloud.automl.v1.ClassificationType} + * + * @typedef TextClassificationDatasetMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextClassificationDatasetMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextClassificationDatasetMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model metadata that is specific to text classification. + * + * @property {number} classificationType + * Output only. Classification type of the dataset used to train this model. + * + * The number should be among the values of [ClassificationType]{@link google.cloud.automl.v1.ClassificationType} + * + * @typedef TextClassificationModelMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextClassificationModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextClassificationModelMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Dataset metadata that is specific to text extraction + * @typedef TextExtractionDatasetMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextExtractionDatasetMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextExtractionDatasetMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model metadata that is specific to text extraction. + * @typedef TextExtractionModelMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextExtractionModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextExtractionModelMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Dataset metadata for text sentiment. + * + * @property {number} sentimentMax + * Required. A sentiment is expressed as an integer ordinal, where higher + * value means a more positive sentiment. The range of sentiments that will be + * used is between 0 and sentiment_max (inclusive on both ends), and all the + * values in the range must be represented in the dataset before a model can + * be created. sentiment_max value must be between 1 and 10 (inclusive). + * + * @typedef TextSentimentDatasetMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextSentimentDatasetMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextSentimentDatasetMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model metadata that is specific to text sentiment. + * @typedef TextSentimentModelMetadata + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextSentimentModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text.proto} + */ +const TextSentimentModelMetadata = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_extraction.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_extraction.js new file mode 100644 index 00000000000..778c0787424 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_extraction.js @@ -0,0 +1,82 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Annotation for identifying spans of text. + * + * @property {Object} textSegment + * An entity annotation will set this, which is the part of the original + * text to which the annotation pertains. + * + * This object should have the same structure as [TextSegment]{@link google.cloud.automl.v1.TextSegment} + * + * @property {number} score + * Output only. A confidence estimate between 0.0 and 1.0. A higher value + * means greater confidence in correctness of the annotation. + * + * @typedef TextExtractionAnnotation + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextExtractionAnnotation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_extraction.proto} + */ +const TextExtractionAnnotation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model evaluation metrics for text extraction problems. + * + * @property {number} auPrc + * Output only. The Area under precision recall curve metric. + * + * @property {Object[]} confidenceMetricsEntries + * Output only. Metrics that have confidence thresholds. + * Precision-recall curve can be derived from it. + * + * This object should have the same structure as [ConfidenceMetricsEntry]{@link google.cloud.automl.v1.ConfidenceMetricsEntry} + * + * @typedef TextExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextExtractionEvaluationMetrics definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_extraction.proto} + */ +const TextExtractionEvaluationMetrics = { + // This is for documentation. Actual contents will be loaded by gRPC. + + /** + * Metrics for a single confidence threshold. + * + * @property {number} confidenceThreshold + * Output only. The confidence threshold value used to compute the metrics. + * Only annotations with score of at least this threshold are considered to + * be ones the model would return. + * + * @property {number} recall + * Output only. Recall under the given confidence threshold. + * + * @property {number} precision + * Output only. Precision under the given confidence threshold. + * + * @property {number} f1Score + * Output only. The harmonic mean of recall and precision. + * + * @typedef ConfidenceMetricsEntry + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_extraction.proto} + */ + ConfidenceMetricsEntry: { + // This is for documentation. Actual contents will be loaded by gRPC. + } +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_segment.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_segment.js new file mode 100644 index 00000000000..458b278a626 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_segment.js @@ -0,0 +1,39 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. + * + * @property {string} content + * Output only. The content of the TextSegment. + * + * @property {number} startOffset + * Required. Zero-based character index of the first character of the text + * segment (counting characters from the beginning of the text). + * + * @property {number} endOffset + * Required. Zero-based character index of the first character past the end of + * the text segment (counting character from the beginning of the text). + * The character at the end_offset is NOT included in the text segment. + * + * @typedef TextSegment + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextSegment definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_segment.proto} + */ +const TextSegment = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_sentiment.js b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_sentiment.js new file mode 100644 index 00000000000..2537d6967a2 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/doc/google/cloud/automl/v1/doc_text_sentiment.js @@ -0,0 +1,84 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Note: this file is purely for documentation. Any contents are not expected +// to be loaded as the JS file. + +/** + * Contains annotation details specific to text sentiment. + * + * @property {number} sentiment + * Output only. The sentiment with the semantic, as given to the + * AutoMl.ImportData when + * populating the dataset from which the model used for the prediction had + * been trained. The sentiment values are between 0 and + * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + * with higher value meaning more positive sentiment. They are completely + * relative, i.e. 0 means least positive sentiment and sentiment_max means + * the most positive from the sentiments present in the train data. Therefore + * e.g. if train data had only negative sentiment, then sentiment_max, would + * be still negative (although least negative). + * The sentiment shouldn't be confused with "score" or "magnitude" + * from the previous Natural Language Sentiment Analysis API. + * + * @typedef TextSentimentAnnotation + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextSentimentAnnotation definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_sentiment.proto} + */ +const TextSentimentAnnotation = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + +/** + * Model evaluation metrics for text sentiment problems. + * + * @property {number} precision + * Output only. Precision. + * + * @property {number} recall + * Output only. Recall. + * + * @property {number} f1Score + * Output only. The harmonic mean of recall and precision. + * + * @property {number} meanAbsoluteError + * Output only. Mean absolute error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * @property {number} meanSquaredError + * Output only. Mean squared error. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * @property {number} linearKappa + * Output only. Linear weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * @property {number} quadraticKappa + * Output only. Quadratic weighted kappa. Only set for the overall model + * evaluation, not for evaluation of a single annotation spec. + * + * @property {Object} confusionMatrix + * Output only. Confusion matrix of the evaluation. + * Only set for the overall model evaluation, not for evaluation of a single + * annotation spec. + * + * This object should have the same structure as [ConfusionMatrix]{@link google.cloud.automl.v1.ConfusionMatrix} + * + * @typedef TextSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1 + * @see [google.cloud.automl.v1.TextSentimentEvaluationMetrics definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1/text_sentiment.proto} + */ +const TextSentimentEvaluationMetrics = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; \ No newline at end of file diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client.js b/packages/google-cloud-automl/src/v1/prediction_service_client.js index 32e29cf3b52..e60c7e1f605 100644 --- a/packages/google-cloud-automl/src/v1/prediction_service_client.js +++ b/packages/google-cloud-automl/src/v1/prediction_service_client.js @@ -133,6 +133,33 @@ class PredictionServiceClient { ), }; + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + this.operationsClient = new gaxModule.lro({ + auth: gaxGrpc.auth, + grpc: gaxGrpc.grpc, + }).operationsClient(opts); + + const batchPredictResponse = protoFilesRoot.lookup( + 'google.cloud.automl.v1.BatchPredictResult' + ); + const batchPredictMetadata = protoFilesRoot.lookup( + 'google.cloud.automl.v1.OperationMetadata' + ); + + this._descriptors.longrunning = { + batchPredict: new gaxModule.LongrunningDescriptor( + this.operationsClient, + batchPredictResponse.decode.bind(batchPredictResponse), + batchPredictMetadata.decode.bind(batchPredictMetadata) + ), + }; + // Put together the default options sent with requests. const defaults = gaxGrpc.constructSettings( 'google.cloud.automl.v1.PredictionService', @@ -157,7 +184,7 @@ class PredictionServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - const predictionServiceStubMethods = ['predict']; + const predictionServiceStubMethods = ['predict', 'batchPredict']; for (const methodName of predictionServiceStubMethods) { const innerCallPromise = predictionServiceStub.then( stub => (...args) => { @@ -170,7 +197,7 @@ class PredictionServiceClient { this._innerApiCalls[methodName] = gaxModule.createApiCall( innerCallPromise, defaults[methodName], - null + this._descriptors.longrunning[methodName] ); } } @@ -222,8 +249,18 @@ class PredictionServiceClient { * Perform an online prediction. The prediction result will be directly * returned in the response. * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 * encoded. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. * * @param {Object} request * The request object that will be sent. @@ -237,6 +274,20 @@ class PredictionServiceClient { * @param {Object.} [request.params] * Additional domain-specific parameters, any string must be up to 25000 * characters long. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -289,6 +340,169 @@ class PredictionServiceClient { return this._innerApiCalls.predict(request, options, callback); } + /** + * Perform a batch prediction. Unlike the online + * Predict, batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via GetOperation + * method. Once the operation is done, + * BatchPredictResult is returned + * in the response field. Available + * for following ML problems: + * * Image Classification + * * Image Object Detection + * * Text Extraction + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the model requested to serve the batch prediction. + * @param {Object} request.inputConfig + * Required. The input configuration for batch prediction. + * + * This object should have the same structure as [BatchPredictInputConfig]{@link google.cloud.automl.v1.BatchPredictInputConfig} + * @param {Object} request.outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * + * This object should have the same structure as [BatchPredictOutputConfig]{@link google.cloud.automl.v1.BatchPredictOutputConfig} + * @param {Object.} [request.params] + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * * For Text Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} 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 a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is a [gax.Operation]{@link https://googleapis.github.io/gax-nodejs/classes/Operation.html} object. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * const automl = require('automl.v1'); + * + * const client = new automl.v1.PredictionServiceClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const inputConfig = {}; + * const outputConfig = {}; + * const request = { + * name: formattedName, + * inputConfig: inputConfig, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the promise pattern. + * client.batchPredict(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Operation#promise starts polling for the completion of the LRO. + * return operation.promise(); + * }) + * .then(responses => { + * const result = responses[0]; + * const metadata = responses[1]; + * const finalApiResponse = responses[2]; + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const inputConfig = {}; + * const outputConfig = {}; + * const request = { + * name: formattedName, + * inputConfig: inputConfig, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the event emitter pattern. + * client.batchPredict(request) + * .then(responses => { + * const [operation, initialApiResponse] = responses; + * + * // Adding a listener for the "complete" event starts polling for the + * // completion of the operation. + * operation.on('complete', (result, metadata, finalApiResponse) => { + * // doSomethingWith(result); + * }); + * + * // Adding a listener for the "progress" event causes the callback to be + * // called on any change in metadata when the operation is polled. + * operation.on('progress', (metadata, apiResponse) => { + * // doSomethingWith(metadata) + * }); + * + * // Adding a listener for the "error" event handles any errors found during polling. + * operation.on('error', err => { + * // throw(err); + * }); + * }) + * .catch(err => { + * console.error(err); + * }); + * + * const formattedName = client.modelPath('[PROJECT]', '[LOCATION]', '[MODEL]'); + * const inputConfig = {}; + * const outputConfig = {}; + * const request = { + * name: formattedName, + * inputConfig: inputConfig, + * outputConfig: outputConfig, + * }; + * + * // Handle the operation using the await pattern. + * const [operation] = await client.batchPredict(request); + * + * const [response] = await operation.promise(); + */ + batchPredict(request, options, callback) { + if (options instanceof Function && callback === undefined) { + callback = options; + options = {}; + } + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name, + }); + + return this._innerApiCalls.batchPredict(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client_config.json b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json index 0786331ff90..9a15857a044 100644 --- a/packages/google-cloud-automl/src/v1/prediction_service_client_config.json +++ b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json @@ -24,6 +24,11 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "BatchPredict": { + "timeout_millis": 20000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_classification.js b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_classification.js index 2bb47dfdd26..5e7a8040026 100644 --- a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_classification.js +++ b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_classification.js @@ -171,7 +171,10 @@ const ClassificationEvaluationMetrics = { * for each example. * * @property {number} f1ScoreAt1 - * Output only. The harmonic mean of recall_at1 and precision_at1. + * Output only. The harmonic mean of + * recall_at1 + * and + * precision_at1. * * @property {number} truePositiveCount * Output only. The number of model created labels that match a ground truth @@ -219,9 +222,9 @@ const ClassificationEvaluationMetrics = { * @property {Object[]} row * Output only. Rows in the confusion matrix. The number of rows is equal to * the size of `annotation_spec_id`. - * `row[i].value[j]` is the number of examples that have ground truth of the - * `annotation_spec_id[i]` and are predicted as `annotation_spec_id[j]` by - * the model being evaluated. + * `row[i].example_count[j]` is the number of examples that have ground + * truth of the `annotation_spec_id[i]` and are predicted as + * `annotation_spec_id[j]` by the model being evaluated. * * This object should have the same structure as [Row]{@link google.cloud.automl.v1beta1.Row} * @@ -239,7 +242,9 @@ const ClassificationEvaluationMetrics = { * Output only. Value of the specific cell in the confusion matrix. * The number of values each row has (i.e. the length of the row) is equal * to the length of the `annotation_spec_id` field or, if that one is not - * populated, length of the display_name field. + * populated, length of the + * display_name + * field. * * @typedef Row * @memberof google.cloud.automl.v1beta1 diff --git a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_image.js b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_image.js index 4c630e2ce10..7846ad2b004 100644 --- a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_image.js +++ b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_image.js @@ -103,6 +103,15 @@ const ImageObjectDetectionDatasetMetadata = { * to have a higher latency, but should also have a higher * prediction quality than other models. * + * @property {number} nodeQps + * Output only. An approximate number of online prediction QPS that can + * be supported by this model per each node on which it is deployed. + * + * @property {number} nodeCount + * Output only. The number of nodes this model is deployed on. A node is an + * abstraction of a machine resource, which can handle online prediction QPS + * as given in the node_qps field. + * * @typedef ImageClassificationModelMetadata * @memberof google.cloud.automl.v1beta1 * @see [google.cloud.automl.v1beta1.ImageClassificationModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1beta1/image.proto} @@ -145,7 +154,7 @@ const ImageClassificationModelMetadata = { * full budget and the stop_reason will be `MODEL_CONVERGED`. * Note, node_hour = actual_hour * number_of_nodes_invovled. * For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, - * the train budget must be between 20,000 and 2,000,000 milli node hours, + * the train budget must be between 20,000 and 900,000 milli node hours, * inclusive. The default value is 216, 000 which represents one day in * wall time. * For model type `mobile-low-latency-1`, `mobile-versatile-1`, @@ -174,6 +183,7 @@ const ImageObjectDetectionModelMetadata = { * Input only. The number of nodes to deploy the model on. A node is an * abstraction of a machine resource, which can handle online prediction QPS * as given in the model's + * * node_qps. * Must be between 1 and 100, inclusive on both ends. * diff --git a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_io.js b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_io.js index 48775296c47..a2e8e9abf47 100644 --- a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_io.js +++ b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_io.js @@ -1021,7 +1021,7 @@ const BatchPredictOutputConfig = { * @property {Object} gcsDestination * The Google Cloud Storage location where the model is to be written to. * This location may only be set for the following model formats: - * "tflite", "edgetpu_tflite", "core_ml", "docker". + * "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". * * Under the directory given as the destination a new one with name * "model-export--", @@ -1048,7 +1048,8 @@ const BatchPredictOutputConfig = { * * * For Image Classification mobile-low-latency-1, mobile-versatile-1, * mobile-high-accuracy-1: - * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker". + * "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + * "docker". * * * For Image Classification mobile-core-ml-low-latency-1, * mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: @@ -1059,6 +1060,8 @@ const BatchPredictOutputConfig = { * * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) * devices. * * tf_saved_model - A tensorflow model in SavedModel format. + * * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + * be used in the browser and in Node.js using JavaScript. * * docker - Used for Docker containers. Use the params field to customize * the container. The container is verified to work correctly on * ubuntu 16.04 operating system. See more at diff --git a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_tables.js b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_tables.js index a63a8458127..8195419d98a 100644 --- a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_tables.js +++ b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_tables.js @@ -96,6 +96,14 @@ const TablesDatasetMetadata = { /** * Model metadata specific to AutoML Tables. * + * @property {number} optimizationObjectiveRecallValue + * Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". + * Must be between 0 and 1, inclusive. + * + * @property {number} optimizationObjectivePrecisionValue + * Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". + * Must be between 0 and 1, inclusive. + * * @property {Object} targetColumnSpec * Column spec of the dataset's primary table's column the model is * predicting. Snapshotted when model creation started. diff --git a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_text.js b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_text.js index 66a122a2124..3cee635ea9f 100644 --- a/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_text.js +++ b/packages/google-cloud-automl/src/v1beta1/doc/google/cloud/automl/v1beta1/doc_text.js @@ -33,6 +33,12 @@ const TextClassificationDatasetMetadata = { /** * Model metadata that is specific to text classification. + * + * @property {number} classificationType + * Output only. Classification type of the dataset used to train this model. + * + * The number should be among the values of [ClassificationType]{@link google.cloud.automl.v1beta1.ClassificationType} + * * @typedef TextClassificationModelMetadata * @memberof google.cloud.automl.v1beta1 * @see [google.cloud.automl.v1beta1.TextClassificationModelMetadata definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1beta1/text.proto} @@ -65,12 +71,11 @@ const TextExtractionModelMetadata = { * Dataset metadata for text sentiment. * * @property {number} sentimentMax - * Required. A sentiment is expressed as an integer ordinal, where higher value - * means a more positive sentiment. The range of sentiments that will be used - * is between 0 and sentiment_max (inclusive on both ends), and all the values - * in the range must be represented in the dataset before a model can be - * created. - * sentiment_max value must be between 1 and 10 (inclusive). + * Required. A sentiment is expressed as an integer ordinal, where higher + * value means a more positive sentiment. The range of sentiments that will be + * used is between 0 and sentiment_max (inclusive on both ends), and all the + * values in the range must be represented in the dataset before a model can + * be created. sentiment_max value must be between 1 and 10 (inclusive). * * @typedef TextSentimentDatasetMetadata * @memberof google.cloud.automl.v1beta1 diff --git a/packages/google-cloud-automl/synth.metadata b/packages/google-cloud-automl/synth.metadata index f56fc9835d8..3d25967a844 100644 --- a/packages/google-cloud-automl/synth.metadata +++ b/packages/google-cloud-automl/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-08T11:08:39.162333Z", + "updateTime": "2019-11-12T18:58:01.393219Z", "sources": [ { "generator": { "name": "artman", - "version": "0.38.0", - "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "122bdbf877ad87439f8dd9d1474a8e5dde188087", - "internalRef": "273381131" + "sha": "6a8c7914d1b79bd832b5157a09a9332e8cbd16d4", + "internalRef": "279991530" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], diff --git a/packages/google-cloud-automl/test/gapic-v1.js b/packages/google-cloud-automl/test/gapic-v1.js index 222de8372f3..63b976185a3 100644 --- a/packages/google-cloud-automl/test/gapic-v1.js +++ b/packages/google-cloud-automl/test/gapic-v1.js @@ -663,6 +663,80 @@ describe('AutoMlClient', () => { }); }); + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.annotationSpecPath( + '[PROJECT]', + '[LOCATION]', + '[DATASET]', + '[ANNOTATION_SPEC]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const name2 = 'name2-1052831874'; + const displayName = 'displayName1615086568'; + const exampleCount = 1517063674; + const expectedResponse = { + name: name2, + displayName: displayName, + exampleCount: exampleCount, + }; + + // Mock Grpc layer + client._innerApiCalls.getAnnotationSpec = mockSimpleGrpcMethod( + request, + expectedResponse + ); + + client.getAnnotationSpec(request, (err, response) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getAnnotationSpec with error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.annotationSpecPath( + '[PROJECT]', + '[LOCATION]', + '[DATASET]', + '[ANNOTATION_SPEC]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.getAnnotationSpec = mockSimpleGrpcMethod( + request, + null, + error + ); + + client.getAnnotationSpec(request, (err, response) => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createModel', function() { it('invokes createModel without error', done => { const client = new automlModule.v1.AutoMlClient({ @@ -682,10 +756,12 @@ describe('AutoMlClient', () => { const name = 'name3373707'; const displayName = 'displayName1615086568'; const datasetId = 'datasetId-2115646910'; + const etag = 'etag3123477'; const expectedResponse = { name: name, displayName: displayName, datasetId: datasetId, + etag: etag, }; // Mock Grpc layer @@ -783,10 +859,12 @@ describe('AutoMlClient', () => { const name2 = 'name2-1052831874'; const displayName = 'displayName1615086568'; const datasetId = 'datasetId-2115646910'; + const etag = 'etag3123477'; const expectedResponse = { name: name2, displayName: displayName, datasetId: datasetId, + etag: etag, }; // Mock Grpc layer @@ -853,10 +931,12 @@ describe('AutoMlClient', () => { const name = 'name3373707'; const displayName = 'displayName1615086568'; const datasetId = 'datasetId-2115646910'; + const etag = 'etag3123477'; const expectedResponse = { name: name, displayName: displayName, datasetId: datasetId, + etag: etag, }; // Mock Grpc layer @@ -1061,6 +1141,298 @@ describe('AutoMlClient', () => { }); }); + describe('deployModel', function() { + it('invokes deployModel without error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.deployModel = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .deployModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes deployModel with error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.deployModel = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .deployModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.deployModel.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.deployModel.metadataDecoder instanceof + Function + ); + }); + }); + + describe('undeployModel', function() { + it('invokes undeployModel without error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const request = { + name: formattedName, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.undeployModel = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .undeployModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes undeployModel with error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const request = { + name: formattedName, + }; + + // Mock Grpc layer + client._innerApiCalls.undeployModel = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .undeployModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.undeployModel.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.undeployModel.metadataDecoder instanceof + Function + ); + }); + }); + + describe('exportModel', function() { + it('invokes exportModel without error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const outputConfig = {}; + const request = { + name: formattedName, + outputConfig: outputConfig, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.exportModel = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .exportModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes exportModel with error', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const outputConfig = {}; + const request = { + name: formattedName, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.exportModel = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .exportModel(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.exportModel.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.exportModel.metadataDecoder instanceof + Function + ); + }); + }); + describe('getModelEvaluation', () => { it('invokes getModelEvaluation without error', done => { const client = new automlModule.v1.AutoMlClient({ @@ -1082,10 +1454,12 @@ describe('AutoMlClient', () => { // Mock response const name2 = 'name2-1052831874'; const annotationSpecId = 'annotationSpecId60690191'; + const displayName = 'displayName1615086568'; const evaluatedExampleCount = 277565350; const expectedResponse = { name: name2, annotationSpecId: annotationSpecId, + displayName: displayName, evaluatedExampleCount: evaluatedExampleCount, }; @@ -1311,6 +1685,110 @@ describe('PredictionServiceClient', () => { }); }); }); + + describe('batchPredict', function() { + it('invokes batchPredict without error', done => { + const client = new automlModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const inputConfig = {}; + const outputConfig = {}; + const request = { + name: formattedName, + inputConfig: inputConfig, + outputConfig: outputConfig, + }; + + // Mock response + const expectedResponse = {}; + + // Mock Grpc layer + client._innerApiCalls.batchPredict = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + + client + .batchPredict(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(responses => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch(err => { + done(err); + }); + }); + + it('invokes batchPredict with error', done => { + const client = new automlModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + + // Mock request + const formattedName = client.modelPath( + '[PROJECT]', + '[LOCATION]', + '[MODEL]' + ); + const inputConfig = {}; + const outputConfig = {}; + const request = { + name: formattedName, + inputConfig: inputConfig, + outputConfig: outputConfig, + }; + + // Mock Grpc layer + client._innerApiCalls.batchPredict = mockLongRunningGrpcMethod( + request, + null, + error + ); + + client + .batchPredict(request) + .then(responses => { + const operation = responses[0]; + return operation.promise(); + }) + .then(() => { + assert.fail(); + }) + .catch(err => { + assert(err instanceof Error); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + + it('has longrunning decoder functions', () => { + const client = new automlModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert( + client._descriptors.longrunning.batchPredict.responseDecoder instanceof + Function + ); + assert( + client._descriptors.longrunning.batchPredict.metadataDecoder instanceof + Function + ); + }); + }); }); function mockSimpleGrpcMethod(expectedRequest, response, error) {